We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
GitHub fields:
assignee = None closed_at = <Date 2021-08-02.17:37:34.149> created_at = <Date 2021-08-02.09:20:47.665> labels = ['type-bug', 'library', '3.9', '3.10', '3.11'] title = 'Subclassing Protocol get different __init__' updated_at = <Date 2021-08-02.17:37:34.149> user = 'https://github.com/uriyyo'
bugs.python.org fields:
activity = <Date 2021-08-02.17:37:34.149> actor = 'lukasz.langa' assignee = 'none' closed = True closed_date = <Date 2021-08-02.17:37:34.149> closer = 'lukasz.langa' components = ['Library (Lib)'] creation = <Date 2021-08-02.09:20:47.665> creator = 'uriyyo' dependencies = [] files = [] hgrepos = [] issue_num = 44806 keywords = ['patch'] message_count = 5.0 messages = ['398736', '398756', '398780', '398782', '398785'] nosy_count = 5.0 nosy_names = ['lukasz.langa', 'serhiy.storchaka', 'miss-islington', 'uriyyo', 'kj'] pr_nums = ['27541', '27545', '27558', '27559', '27543'] priority = 'normal' resolution = 'fixed' stage = 'resolved' status = 'closed' superseder = None type = 'behavior' url = 'https://bugs.python.org/issue44806' versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']
The text was updated successfully, but these errors were encountered:
When we subclassing Protocol, we get a __init__ differing from default one but the protocol in question didn't define any __init__.
More information can be found here - python/typing#644
Sorry, something went wrong.
There is other related case:
>>> from typing import * >>> class P(Protocol): pass ... >>> class B: ... def __init__(self): ... self.test = 'OK' ... >>> class D(P, B): ... pass ... >>> D().test Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'D' object has no attribute 'test'
New changeset 043cd60 by Serhiy Storchaka in branch 'main': bpo-44806: Fix __init__ in subclasses of protocols (GH-27545) 043cd60
New changeset 0f6a773 by Miss Islington (bot) in branch '3.9': bpo-44806: Fix __init__ in subclasses of protocols (GH-27545) (GH-27559) 0f6a773
New changeset 2cc19a5 by Miss Islington (bot) in branch '3.10': bpo-44806: Fix __init__ in subclasses of protocols (GH-27545) 2cc19a5
No branches or pull requests
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: