[issue40408] GenericAlias does not support nested type variables

2020-05-04 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: > But this behavior is not specified and is not covered by tests. FWIW, to be most close to the static type checkers behavior, both D[int][str] and D[int, str] should fail for D = Dict[T, List]. Not important however, since this is a really rare corner

[issue40408] GenericAlias does not support nested type variables

2020-05-04 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue40408] GenericAlias does not support nested type variables

2020-05-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 41a64587a0fd68bcd21ba42999cd3940801dff7c by Serhiy Storchaka in branch 'master': bpo-40408: Fix support of nested type variables in GenericAlias. (GH-19836) https://github.com/python/cpython/commit/41a64587a0fd68bcd21ba42999cd3940801dff7c

[issue40408] GenericAlias does not support nested type variables

2020-05-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There is a difference between PR 19836 and the typing module in handling nested unsubscribed generic aliases: >>> from typing import * >>> T = TypeVar('T') >>> D1 = Dict[T, List] >>> D2 = dict[T, List] >>> D1.__parameters__ (~T,) >>> D1[int]

[issue40408] GenericAlias does not support nested type variables

2020-05-01 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +19154 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19836 ___ Python tracker

[issue40408] GenericAlias does not support nested type variables

2020-04-30 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- assignee: -> serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue40408] GenericAlias does not support nested type variables

2020-04-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Not yet. If you don't prefer to fix it yourself, I'll do it as soon as I have time. -- ___ Python tracker ___

[issue40408] GenericAlias does not support nested type variables

2020-04-27 Thread Guido van Rossum
Guido van Rossum added the comment: Good catch. Is there a reasonable fix? -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue40408] GenericAlias does not support nested type variables

2020-04-27 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : While trying to replace typing._GenericAlias with GenericAlias I have found that the latter does not support nested type variables. >>> from typing import * >>> T = TypeVar('T') >>> X = List[List[T]] >>> X.__parameters__ (~T,) >>> X[int]