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 Python 3.10 errors #11

Merged
merged 1 commit into from
Oct 6, 2024
Merged

Conversation

joelspadin
Copy link
Collaborator

typing.Self requires Python 3.11. Replaced it with the class name for types that aren't subclassed or a TypeVar for types that are.

The type annotation on Hardware.from_dict() must be given as a string, or pyupgrade will convert it to type[_Self], which breaks because Hardware has a member named "type" (which cannot be renamed since it must match the name of the YAML files the class represents).

Fixes #9

typing.Self requires Python 3.11. Replaced it with the class name for
types that aren't subclassed or a TypeVar for types that are.

The type annotation on Hardware.from_dict() must be given as a string,
or pyupgrade will convert it to type[_Self], which breaks because
Hardware has a member named "type" (which cannot be renamed since it
must match the name of the YAML files the class represents).

Fixes zmkfirmware#9
@joelspadin joelspadin merged commit ff153c2 into zmkfirmware:main Oct 6, 2024
1 check passed
@joelspadin joelspadin deleted the fix-python-3.10 branch October 6, 2024 20:32
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.

Python 3.10 support
1 participant