Skip to content

Fix Python 3.8 syntax error by removing 3.10 specific union type hint#1478

Open
wong-ziyi wants to merge 2 commits into
MouseLand:mainfrom
wong-ziyi:fix-python38-typing
Open

Fix Python 3.8 syntax error by removing 3.10 specific union type hint#1478
wong-ziyi wants to merge 2 commits into
MouseLand:mainfrom
wong-ziyi:fix-python38-typing

Conversation

@wong-ziyi

Copy link
Copy Markdown

Description

The recent updates to gui.py introduced a Python 3.10+ specific type hinting syntax (str | int) on the color property setter:

    @color.setter
    def color(self, value: str|int):

This breaks compatibility for users running Python 3.8 or 3.9, resulting in a TypeError: unsupported operand type(s) for |: 'type' and 'type' upon starting the GUI.

Solution

This PR simply removes the type hint (or could use typing.Union[str, int]) to restore compatibility with older supported Python versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant