This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author anuppari
Recipients anuppari, lys.nikolaou, pablogsal
Date 2021-08-27.01:29:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1630027789.49.0.847415585989.issue45024@roundup.psfhosted.org>
In-reply-to
Content
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?
History
Date User Action Args
2021-08-27 01:29:49anupparisetrecipients: + anuppari, lys.nikolaou, pablogsal
2021-08-27 01:29:49anupparisetmessageid: <1630027789.49.0.847415585989.issue45024@roundup.psfhosted.org>
2021-08-27 01:29:49anupparilinkissue45024 messages
2021-08-27 01:29:49anupparicreate