[3.5] bpo-28556: Update to typing: treat subscripted generics as proxies (#265) by Mariatta · Pull Request #269 · python/cpython
(cherry picked from commit abb3b8a)
| def __setattr__(self, attr, value): | ||
| # We consider all the subscripted genrics as proxies for original class | ||
| if attr.startswith('__') and attr.endswith('__'): | ||
| super(GenericMeta, self).__setattr__(attr, value) |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a small question, why not just using super().__setattr__(attr, value) but super(GenericMeta, self)? Isn't that equivalent at this case?
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In principle you are right. This is mostly for similarity with next case (also there is Python 2 backport of this module, so that sometimes I just write the same code for both)
akruis added a commit to akruis/cpython that referenced this pull request
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