Skip to content
New issue

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

Fix AttributeError when using generic SerializableType subclass #275

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

Feuermurmel
Copy link
Contributor

@Feuermurmel Feuermurmel commented Jan 7, 2025

When using PEP 695 syntax to create a generic class, some private attributes are set up by the runtime in __init_subclass__(). Those attributes are needed when specializing the generic class.

SerializableType did not call super().__init_subclass__() and thus those attributes were missing, leading to an AttributeError.

Fixes #274

@Feuermurmel Feuermurmel changed the title Fix #274 Fix AttributeError when using generic SerializableType subclass Jan 7, 2025
When using PEP 695 syntax to create a generic class, some
private attributes are set up by the runtime in __init_subclass__().
Those attributes are needed when specializing the generic class.

SerializableType did not call super().__init_subclass__() and
thus those attributes were missing, leading to an AttributeError.
@Fatal1ty Fatal1ty merged commit 68fb7d2 into Fatal1ty:master Jan 7, 2025
@Fatal1ty
Copy link
Owner

Fatal1ty commented Jan 8, 2025

Looks good, thank you for your contribution!

@Feuermurmel
Copy link
Contributor Author

Sure! 😊 Thanks for acting on it so quickly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AttributeError when using PEP 695 syntax SerializableType subclass
2 participants