Skip to content

WPI/ENH: Match __init__ signature#6

Open
bashtage wants to merge 1 commit into
althonos:forkfrom
bashtage:match-signature
Open

WPI/ENH: Match __init__ signature#6
bashtage wants to merge 1 commit into
althonos:forkfrom
bashtage:match-signature

Conversation

@bashtage

Copy link
Copy Markdown

Match signature of property

Match signature of property
@bashtage

Copy link
Copy Markdown
Author

This is not complete, but I wanted to see if you support matching properties sig. This caught me out since I have a metaclass that checks for properties and then reinitializes them. The call to cached_property is different and so rather than have

if isinstance(attr, property):
    attr.__class__(attr.fset, attr.fget, attr.fdel, attr.__doc__)

I have to special case cached_property. I believe this is called the Liskov substitution principle.

@bashtage bashtage changed the title ENH: Match __init__ signature WPI/ENH: Match __init__ signature Sep 14, 2019
@althonos

Copy link
Copy Markdown
Owner

Wonderful, thank you. Is it clear to merge or do you want to change some more things?

@bashtage

bashtage commented Sep 15, 2019 via email

Copy link
Copy Markdown
Author

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