◐ Shell
clean mode source ↗

[3.5] bpo-28556: Update to typing: treat subscripted generics as proxies (#265) by Mariatta · Pull Request #269 · python/cpython

@Mariatta

(cherry picked from commit abb3b8a)
(cherry picked from commit 365cb5b)

(cherry picked from commit abb3b8a)

louisom

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

Jun 13, 2021
A failure to unpickle a frame could cause a NULL pointer access when
deallocating the frame. This has been fixed.

jaraco pushed a commit that referenced this pull request

Dec 2, 2022