[issue41780] Generic Alias attributes nor in dir()

2020-09-15 Thread Guido van Rossum
Change by Guido van Rossum : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue41780] Generic Alias attributes nor in dir()

2020-09-15 Thread miss-islington
miss-islington added the comment: New changeset 49917d576a578c8c29b8dbcbd5257c366a53d498 by Miss Islington (bot) in branch '3.9': bpo-41780: Fix __dir__ of types.GenericAlias (GH-22262) https://github.com/python/cpython/commit/49917d576a578c8c29b8dbcbd5257c366a53d498 --

[issue41780] Generic Alias attributes nor in dir()

2020-09-15 Thread miss-islington
Change by miss-islington : -- pull_requests: +21320 pull_request: https://github.com/python/cpython/pull/22264 ___ Python tracker ___

[issue41780] Generic Alias attributes nor in dir()

2020-09-15 Thread miss-islington
miss-islington added the comment: New changeset 2e87774df1a0eaf2a1fe8cc4d958df60f7125b6e by Batuhan Taskaya in branch 'master': bpo-41780: Fix __dir__ of types.GenericAlias (GH-22262) https://github.com/python/cpython/commit/2e87774df1a0eaf2a1fe8cc4d958df60f7125b6e -- nosy:

[issue41780] Generic Alias attributes nor in dir()

2020-09-15 Thread Batuhan Taskaya
Change by Batuhan Taskaya : -- keywords: +patch pull_requests: +21318 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/22262 ___ Python tracker

[issue41780] Generic Alias attributes nor in dir()

2020-09-15 Thread Guido van Rossum
Change by Guido van Rossum : -- assignee: docs@python -> stage: -> needs patch ___ Python tracker ___ ___ Python-bugs-list

[issue41780] Generic Alias attributes nor in dir()

2020-09-15 Thread Guido van Rossum
Guido van Rossum added the comment: The forwarding of `__class__`, and the resulting difference between `type(list[int])` and `list[int].__class__` are intentional. I think overriding `__dir__` along the lines suggested by Allan (but in C of course) would be the best solution. --

[issue41780] Generic Alias attributes nor in dir()

2020-09-15 Thread Batuhan Taskaya
Batuhan Taskaya added the comment: Okay, so IIRC if we stop forwarding __class__ (add it as an exception to attr_exceptions) it would return us the original dir(), and also solve the inconsistency of the example you gave; > >>> list.__class__ > > >>> list[int].__class__ > > > >>>

[issue41780] Generic Alias attributes nor in dir()

2020-09-15 Thread Allan Daemon
Allan Daemon added the comment: > I actually have no idea where dir() gets its information. I will share what I find out already, so it may hopefully be helpful. The dir function used is the general object.__dir__ function, defined in Objects/typeobject.c:type___dir___impl(), that just

[issue41780] Generic Alias attributes nor in dir()

2020-09-14 Thread Batuhan Taskaya
Batuhan Taskaya added the comment: > @Batuhan, do you want to look into this? Sure, will check it out! -- ___ Python tracker ___

[issue41780] Generic Alias attributes nor in dir()

2020-09-14 Thread Guido van Rossum
Guido van Rossum added the comment: I actually have no idea where dir() gets its information. IIRC the implementation was a collaboration with Batuhan -- @Batuhan, do you want to look into this? Presumably some metadata needs to be added to genericaliasobject.c. -- nosy:

[issue41780] Generic Alias attributes nor in dir()

2020-09-14 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +gvanrossum ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue41780] Generic Alias attributes nor in dir()

2020-09-14 Thread Allan Daemon
New submission from Allan Daemon : The implementation of PEP 585 in 3.9 adds some new attributes, but they aren't listed with dir() (then, not list in autocomplete and IntelliSense). Python 3.9.0rc1+ (heads/3.9:d7cd1164c1, Aug 25 2020, 17:27:09) >>> li = list[int] >>> li.__origin__ >>>