Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions st3/sublime_lib/_compat/typing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
try:
import sys

if sys.version_info >= (3, 8, 0):
from typing import * # noqa: F401, F403
except ImportError:
else:
from .typing_stubs import * # type: ignore # noqa: F401, F403
Comment on lines +3 to 6
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be something like this instead so that the Sublime Text typing depedency is used when installed?

if sys.version_info >= (3, 8, 0):
    from typing import *  # noqa: F401, F403
else:
    try:
        from typing import *  # noqa: F401, F403
    except ImportError:
        from .typing_stubs import *  # type: ignore # noqa: F401, F403

Although I'm not sure what would be the point really. It would not change the runtime behavior and is not needed for pyright either.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not needed, and we've had issues with a similar approach with enum.