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 union operator #940

Merged
merged 1 commit into from
Aug 5, 2024
Merged

Fix union operator #940

merged 1 commit into from
Aug 5, 2024

Conversation

ispobock
Copy link
Collaborator

@ispobock ispobock commented Aug 5, 2024

Motivation

Facing error:

TypeError: unsupported operand type(s) for |: '_GenericAlias' and 'NoneType'

The | operator is introduced in Python 3.10. (PEP604)

Modification

Replace | with Optional for compatibility with Python 3.8 and 3.9.

cc: @AidanCooper

@ispobock ispobock merged commit a9c833d into sgl-project:main Aug 5, 2024
3 checks passed
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.

2 participants