Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add property support for Box #239

Merged
merged 1 commit into from
Jan 13, 2023

Conversation

Serge45
Copy link

@Serge45 Serge45 commented Jan 10, 2023

As requested to issue #211, this PR makes adding property with getter, setter and deleter to Box possible.

The idea is to check if the field is a property (a private function _get_property_func was added for this), if so,
for setter, getter or deleter, box will route to the customized function if exists else the original implementation.

 - Adding property with getter, setter and deleter to Box is now possible
   via subclassing.
Copy link
Owner

@cdgriffith cdgriffith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is brilliant, didn't know this was possible!

@cdgriffith cdgriffith merged commit 2e71594 into cdgriffith:develop Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants