Skip to content

typing.Protocol in 3.11 needs to be backported #104

Closed
@Gobot1234

Description

@Gobot1234
In [6]: @runtime_checkable
   ...: class BaseBadge(Protocol):
   ...:     def __init__(self) -> None: ...

In [7]: BaseBadge.__init__
Out[7]: <function typing._no_init_or_replace_init(self, *args, **kwargs)>

This behaviour is not consistent with python 3.11

>>> from typing import *
>>> @runtime_checkable
... class BaseBadge(Protocol):
...     def __init__(self) -> None: ...
... 
>>> BaseBadge.__init__
<function BaseBadge.__init__ at 0x104f249a0>

This may have made me slightly concerned I was loosing my sanity in a subclass today 😀

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions