Message323377
Why can't we add an ABC into a NamedTuple instance's MRO? Because while I like Eric's solution, it seems to be backwards: tuple and list are not the special cases—NamedTuple is.
All sequences accept an iterable in their constructor, and NamedTuple doesn't. So it should be NamedTuple that is marked as being "weird". Right now, NamedTuple instances claim to be tuples, but don't accept iterables to initialize themselves. That seems wrong.
This problem that we have with dataclass can easily pop up somewhere else, and it will require the same restriction to list and tuple types to fix it (breaking user-defined types).
Is it imposible to add to the MRO of NamedTuple instances? |
|
Date |
User |
Action |
Args |
2018-08-10 18:07:45 | NeilGirdhar | set | recipients:
+ NeilGirdhar, eric.smith, levkivskyi, alexdelorenzo |
2018-08-10 18:07:45 | NeilGirdhar | set | messageid: <1533924465.6.0.56676864532.issue34363@psf.upfronthosting.co.za> |
2018-08-10 18:07:45 | NeilGirdhar | link | issue34363 messages |
2018-08-10 18:07:45 | NeilGirdhar | create | |
|