Skip to content

Treat subscripted generics as "proxies" for original class. - #393

Merged
ilevkivskyi merged 3 commits into
python:masterfrom
ilevkivskyi:play-with-descriptor
Feb 23, 2017
Merged

ilevkivskyi merged 3 commits into
python:masterfrom
ilevkivskyi:play-with-descriptor

Conversation

@ilevkivskyi

Copy link
Copy Markdown
Member

Fixes #392

As noted by @JukkaL, conceptually, subscripting generic classes should not create independent class objects (type should be erased at runtime). In particular, class variables should be shared between subscripted generics and original class.

Here I implement this semantics using a custom __setattr__.

@gvanrossum There is a question (assuming we agree that this is needed) whether this should go in 3.6.1 that has "feature freeze" in less than a week, or should we postpone this until 3.6.2?

@gvanrossum

gvanrossum commented Feb 23, 2017 via email

Copy link
Copy Markdown
Member
@ilevkivskyi

Copy link
Copy Markdown
Member Author

I think we should get this in

OK, I am going to merge this soon (unless you or @JukkaL express any concerns), and will then make a PR to python/cpython repo.

@ilevkivskyi

Copy link
Copy Markdown
Member Author

OK, so here is the PR to python/cpython python/cpython#265

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants