Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Use typing Union instead of | to support Python<3.10 #501

Merged
merged 1 commit into from
Jun 6, 2023

Conversation

Hansimov
Copy link
Contributor

@Hansimov Hansimov commented Jun 6, 2023

Issue Description

The union operator | suggested in PEP 604 is introduced to Python >= 3.10.
So this syntax is not compatible with Python < 3.10.

Solution

Use Union[X, Y] to replace X | Y.
See more details in Python doc for typing.Union.

Changes Example

In src/EdgeGPT/conversation.py:

+ from typing import Union

@@ -10,9 +10,9 @@
class Conversation:
    def __init__(
        self,
--        proxy: str | None = None,
++        proxy: Union[str, None] = None,

@acheong08 acheong08 merged commit c010127 into acheong08:master Jun 6, 2023
13 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants