Skip to content

[WIP] make This inherit from Instance and add ThisType#257

Closed
rmorshea wants to merge 2 commits intoipython:masterfrom
rmorshea:this_inheritance
Closed

[WIP] make This inherit from Instance and add ThisType#257
rmorshea wants to merge 2 commits intoipython:masterfrom
rmorshea:this_inheritance

Conversation

@rmorshea
Copy link
Copy Markdown
Contributor

@rmorshea rmorshea commented Jul 19, 2016

With the new metaclass setup phase class_init brought by #114, we can now make This properly inherit from Instance by setting its klass before an instance has a chance to request a default value.

This means that normal dynamic default value heuristics from Instance, are now possible in This.

This pr also adds a ThisType trait 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 This where the keywords 'args' or 'kwargs' were used as metadata

to do: add tests for new dynamic default value features

@minrk minrk added this to the 5.0 milestone Jul 28, 2016
@minrk minrk changed the title make This inherit from Instance and add ThisType [WIP] make This inherit from Instance and add ThisType Jul 28, 2016
@minrk
Copy link
Copy Markdown
Member

minrk commented Jul 28, 2016

breakage : this breaks uses of This where the keywords 'args' or 'kwargs' were used as metadata

is there a reason for the breakage that's not fixable?

ThisType

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.

@rmorshea
Copy link
Copy Markdown
Contributor Author

rmorshea commented Nov 4, 2016

@minrk, closed in favor of #317

@rmorshea rmorshea closed this Mar 21, 2017
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