Message414236
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. |
|
Date |
User |
Action |
Args |
2022-03-01 03:20:11 | JelleZijlstra | set | recipients:
+ JelleZijlstra, gvanrossum, lukasz.langa, uriyyo, kj, adriangb |
2022-03-01 03:20:11 | JelleZijlstra | set | messageid: <1646104811.59.0.181592858635.issue44807@roundup.psfhosted.org> |
2022-03-01 03:20:11 | JelleZijlstra | link | issue44807 messages |
2022-03-01 03:20:11 | JelleZijlstra | create | |
|