Message377908
Hm, you're effectively proposing to compute (or update) __abstractmethods__ lazily. There are a number of subtleties with that, e.g. __abstractmethods__ is currently a frozenset, and a base class's __abstractmethods__ is used when computing the __abstractmethods__ of new subclasses.
Moreover, the instantiation check is in object_new(), in typeobject.c.
The good news is that when you assign an empty iterable to cls.__abstractmethod__ the bit that object_new() checks is cleared, so other approaches are still open.
I think adding the API currently proposed is a reasonable compromise. |
|
Date |
User |
Action |
Args |
2020-10-04 00:43:54 | gvanrossum | set | recipients:
+ gvanrossum, rhettinger, eric.smith, python-dev, avrahami.ben |
2020-10-04 00:43:54 | gvanrossum | set | messageid: <1601772234.47.0.0633762458425.issue41905@roundup.psfhosted.org> |
2020-10-04 00:43:54 | gvanrossum | link | issue41905 messages |
2020-10-04 00:43:54 | gvanrossum | create | |
|