[issue36517] typing.NamedTuple does not support mixins

2021-02-09 Thread Ben Avrahami
Ben Avrahami added the comment: The patch PR blocks out a useful idiom: generic Nametuple >>> class LLNode(NamedTuple, Generic[T]): ... value :T ... next: Optional[LLNode[T]] I put forward that, at the least, NamedTuple should accept do-nothing bases like Generic. -- nosy:

[issue36517] typing.NamedTuple does not support mixins

2020-04-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset a94e6272f16381349dbed74cdb738ec8ae23b4fe by Serhiy Storchaka in branch 'master': bpo-36517: Raise error on multiple inheritance with NamedTuple (GH-19363) https://github.com/python/cpython/commit/a94e6272f16381349dbed74cdb738ec8ae23b4fe

[issue36517] typing.NamedTuple does not support mixins

2020-04-04 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch nosy: +serhiy.storchaka nosy_count: 3.0 -> 4.0 pull_requests: +18725 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19363 ___ Python tracker

[issue36517] typing.NamedTuple does not support mixins

2019-04-06 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Hm, it looks like we can support this. I however don't think the proposed "patch" is the right way to fix it, since this makes the implementation with and without a mixin quite different. Also I am not sure I will have time to work on this in the nearest

[issue36517] typing.NamedTuple does not support mixins

2019-04-03 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: -gvanrossum ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36517] typing.NamedTuple does not support mixins

2019-04-03 Thread Stéphane Wirtel
Change by Stéphane Wirtel : -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36517] typing.NamedTuple does not support mixins

2019-04-03 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +gvanrossum, levkivskyi ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue36517] typing.NamedTuple does not support mixins

2019-04-03 Thread Andrew Wason
New submission from Andrew Wason : Subclassing typing.NamedTuple an inheriting from a mixin class does not work. It does work for collections.namedtuple, and can be worked around by modifying typing.NamedTupleMeta: >>> import collections >>> import typing >>> >>> >>> class Mixin: ... def