Rick Teachey <[email protected]> added the comment:
Eric, looking at the PR; note that if you do this for the __set_name__ check:
if inspect.ismethoddescriptor(self.default):
...an object like the one below will not get its __set_name__ called, even
though PEP 487 says it should:
class D:
def __set_name__(self, o, n):
self.name = n
class C:
d: int = D()
if __name__ == "__main__":
print(f"C.d.name = {C.d.name}") # __set_name__ was called
assert inspect.ismethoddescriptor(C.d) # Error
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue33141>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com