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 JelleZijlstra
Recipients JelleZijlstra, adriangb, gvanrossum, kj, lukasz.langa, uriyyo
Date 2022-03-01.03:20:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1646104811.59.0.181592858635.issue44807@roundup.psfhosted.org>
In-reply-to
Content
Regardless of mypy's behavior (which isn't impacted by what typing.py does), there's a legitimate complaint here about the runtime behavior: any `__init__` method defined in a Protocol gets silently replaced.

>>> from typing import Protocol
>>> class X(Protocol):
...     def __init__(self, x, y): pass
... 
>>> X.__init__
<function _no_init_or_replace_init at 0x10de4e5c0>

Fixing that won't be easy though, unless we give up on making it impossible to instantiate a Protocol.
History
Date User Action Args
2022-03-01 03:20:11JelleZijlstrasetrecipients: + JelleZijlstra, gvanrossum, lukasz.langa, uriyyo, kj, adriangb
2022-03-01 03:20:11JelleZijlstrasetmessageid: <1646104811.59.0.181592858635.issue44807@roundup.psfhosted.org>
2022-03-01 03:20:11JelleZijlstralinkissue44807 messages
2022-03-01 03:20:11JelleZijlstracreate