Message387169
Basically, the idea is to add the ability to mark abstract classes as strict.
What does this mean - in case when a class inherits from a strict abstract base class and doesn't implement all abstract methods then it will fail to create a class.
For instance:
>>> class Iterable(ABC, strict=True):
... @abstractmethod
... def __iter__(self):
... pass
>>> class MyClass(Iterable):
... pass
TypeError: Can't create class MyClass with unimplemented strict abstract method __iter__
That allows creating abc classes and be sure that class defines a required method, it will be perfrormed on a class declaration stage rather than class instance creation. |
|
Date |
User |
Action |
Args |
2021-02-17 17:28:13 | uriyyo | set | recipients:
+ uriyyo |
2021-02-17 17:28:12 | uriyyo | set | messageid: <1613582892.97.0.748094590346.issue43243@roundup.psfhosted.org> |
2021-02-17 17:28:12 | uriyyo | link | issue43243 messages |
2021-02-17 17:28:12 | uriyyo | create | |
|