Message400387
Since the container ABCs are normal classes, and Protocol cannot subclass normal classes, there's no way to create a protocol that extends the ABCs without explicitly listing out all the methods needed for the collection. e.g., can't do this: from typing import Iterable, Protocol class IterableWithMethod(Iterable, Protocol): def method(self) -> None: pass Since the ABCs don't provide any default implementations (I think?), maybe they should just be defined as runtime checkable protocols instead of ABCs? | |
| Date | User | Action | Args | | 2021-08-27 01:29:49 | anuppari | set | recipients: + anuppari, lys.nikolaou, pablogsal | | 2021-08-27 01:29:49 | anuppari | set | messageid: <1630027789.49.0.847415585989.issue45024@roundup.psfhosted.org> | | 2021-08-27 01:29:49 | anuppari | link | issue45024 messages | | 2021-08-27 01:29:49 | anuppari | create | | |