Skip to content

feat: add type hints to functions and methods in jdatetime module#181

Merged
slashmili merged 3 commits into
slashmili:mainfrom
mojixcoder:feat-add-type-hints
May 19, 2026
Merged

feat: add type hints to functions and methods in jdatetime module#181
slashmili merged 3 commits into
slashmili:mainfrom
mojixcoder:feat-add-type-hints

Conversation

@mojixcoder
Copy link
Copy Markdown
Contributor

No description provided.

@slashmili
Copy link
Copy Markdown
Owner

Thanks @mojixcoder! Nice work

What is the minimum Python that support type hints? Currently we support Python down to version 3.9.

@mojixcoder
Copy link
Copy Markdown
Contributor Author

mojixcoder commented May 18, 2026

Thanks @mojixcoder! Nice work

What is the minimum Python that support type hints? Currently we support Python down to version 3.9.

Python 3.5 introduced type hints via PEP 484 (typing module).

Key milestones:

3.5 — typing module, basic annotations
3.9 — built-in generics (list[int], dict[str, int] instead of typing.List, typing.Dict)
3.10 — union syntax (X | Y instead of typing.Union[X, Y])
3.10 — typing.TypeAlias
3.11 — typing.Self, typing.Never
from future import annotations (PEP 563, available since 3.7) enables forward references and also lets you use 3.10+ syntax (like X | Y) on older Python versions, since annotations are stored as strings rather than evaluated eagerly.

Practical answer for your case

Since you already support Python 3.9, you are at a very reasonable baseline:

You get modern generic syntax (list[int])
Most ecosystem typing libraries still support 3.9+
You avoid legacy typing.List-style verbosity

Recommendation
If you want maximum compatibility → 3.5+
If you want modern, clean typing without legacy patterns → 3.9+ (your current baseline is solid)
If you want best DX today → 3.10+ (mainly for | unions)

@slashmili slashmili merged commit 38b1a48 into slashmili:main May 19, 2026
13 checks passed
@slashmili
Copy link
Copy Markdown
Owner

Thanks! 🎉

@slashmili
Copy link
Copy Markdown
Owner

released as 5.3.0

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