Skip to content

refactor: declare TypeAliases explicitly - #652

Open
spaceone wants to merge 1 commit into
python-ldap:mainfrom
spaceone:refactor/declare-type-aliases
Open

spaceone wants to merge 1 commit into
python-ldap:mainfrom
spaceone:refactor/declare-type-aliases

Conversation

@spaceone

Copy link
Copy Markdown
Contributor

as it is required by python-typesched linter checks

@spaceone
spaceone force-pushed the refactor/declare-type-aliases branch from a1cfe54 to 7538e45 Compare September 15, 2026 21:39
@mistotebe

Copy link
Copy Markdown
Contributor

OK if we target this for 4.0, since TypeAlias is not in Python 3.9?

@spaceone

spaceone commented Sep 16, 2026

Copy link
Copy Markdown
Contributor Author

if you are okay with it I would make a conditional import e.g. into _types.py: compat.py (or on every use, since compat seems unused):

try:
    from typing import TypeAlias
except ImportError:
     from typing_extensions import TypeAlias

@spaceone
spaceone force-pushed the refactor/declare-type-aliases branch 2 times, most recently from 140e0f0 to 8420832 Compare September 16, 2026 10:57
@spaceone

Copy link
Copy Markdown
Contributor Author

@mistotebe I found a fallback strategy for Py3.9 - please have a look at the latest diff. All tests passing.

@spaceone
spaceone force-pushed the refactor/declare-type-aliases branch 3 times, most recently from c3ed69b to 8b79d60 Compare September 16, 2026 11:23
@spaceone
spaceone force-pushed the refactor/declare-type-aliases branch from 8b79d60 to 80c3c6f Compare September 16, 2026 11:28
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