[issue45755] Specialized generic class does not return class attributes in dir

2021-12-17 Thread miss-islington
miss-islington added the comment: New changeset 87539cc716fab47cd4f501f2441c4ab8e80bce6f by Miss Islington (bot) in branch '3.10': bpo-45755: [typing] Reveal class attributes of generic in generic aliases in `dir()` (GH-29962)

[issue45755] Specialized generic class does not return class attributes in dir

2021-12-17 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +28383 pull_request: https://github.com/python/cpython/pull/30166 ___ Python tracker

[issue45755] Specialized generic class does not return class attributes in dir

2021-12-16 Thread Guido van Rossum
Guido van Rossum added the comment: I think a 3.10 backport would be appreciated. -- ___ Python tracker ___ ___ Python-bugs-list

[issue45755] Specialized generic class does not return class attributes in dir

2021-12-16 Thread Ken Jin
Ken Jin added the comment: Hi, I won't be backporting this to 3.9 since I don't like having jarring behavior changes so late into the bugfix cycle of a Python version. I'm tempted to backport to 3.10. For now, I'll be conservative and just merge it in main. Please do tell me if any of you

[issue45755] Specialized generic class does not return class attributes in dir

2021-12-16 Thread Ken Jin
Ken Jin added the comment: New changeset d6e13747161d7b634b47d2d3d212ed3be4a21fab by Ken Jin in branch 'main': bpo-45755: [typing] Reveal class attributes of generic in generic aliases in `dir()` (GH-29962) https://github.com/python/cpython/commit/d6e13747161d7b634b47d2d3d212ed3be4a21fab

[issue45755] Specialized generic class does not return class attributes in dir

2021-12-07 Thread Ken Jin
Change by Ken Jin : -- keywords: +patch pull_requests: +28187 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29962 ___ Python tracker ___

[issue45755] Specialized generic class does not return class attributes in dir

2021-12-06 Thread Ken Jin
Ken Jin added the comment: Not exactly sure if this is a bug, but the reason is that Foo[int] used to be a class, now it's a plain object. It's a change brought in 3.7 by PEP 560. 3.6: >>> isinstance(Foo[int], type) True >>> Foo[int].__dir__ >> type(Foo[int].__dir__) main: >>>

[issue45755] Specialized generic class does not return class attributes in dir

2021-11-13 Thread Guido van Rossum
Guido van Rossum added the comment: Isn’t the solution to use the unspecialized class? -- ___ Python tracker ___ ___

[issue45755] Specialized generic class does not return class attributes in dir

2021-11-12 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: This seems to be an issue with typing than mock since mock just uses the output from dir() . I am not able to bisect the relevant change but below is the output of dir(Foo[int]) in Python 3.6 and master. Python 3.6.9 ['__abstractmethods__',