[WIP] make This inherit from Instance and add ThisType#257
Closed
rmorshea wants to merge 2 commits intoipython:masterfrom
Closed
[WIP] make This inherit from Instance and add ThisType#257rmorshea wants to merge 2 commits intoipython:masterfrom
rmorshea wants to merge 2 commits intoipython:masterfrom
Conversation
Member
is there a reason for the breakage that's not fixable?
What are some use cases of ThisType? I can't think of any cases where I've had an attribute on a class that is a class itself, restricted to a subclass of the class itself. |
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With the new metaclass setup phase
class_initbrought by #114, we can now makeThisproperly inherit fromInstanceby setting itsklassbefore an instance has a chance to request a default value.This means that normal dynamic default value heuristics from
Instance, are now possible inThis.This pr also adds a
ThisTypetrait which, presumably, was never implemented in the past because it would have been too contrived. However if it's unnecessary, I can revert the commit that added it.breakage : this breaks uses of
Thiswhere the keywords'args'or'kwargs'were used as metadatato do: add tests for new dynamic default value features