Opened 15 months ago

Last modified 4 months ago

#29299 new Cleanup/optimization

Add type hints (PEP 484) and variable annotations (PEP 526)

Reported by: Andreas Galazis Owned by: nobody
Component: Core (Other) Version: 2.0
Severity: Normal Keywords:
Cc: Adam (Chainz) Johnson, Zach Borboa, Vlastimil Zíma Triage Stage: Someday/Maybe
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Andreas Galazis)

Adhering to Type hints(PEP 484) / type annotations could contribute to being more explicit / performing code analysis and checks on Django projects. Intellisense based on type annotations can also contribute to faster and less error-prone coding experience.

Typesheds will be a pain to maintain across versions. Based on my experience with typescript typings, the most immaculate situation is shipping typings within the project, even though shipping external typings is mature in that case. Nevertheless, inline typings can help Django project development as well.

Adding to the docs any future plans regarding this would be helpful to prospective developers.

Change History (10)

comment:1 Changed 15 months ago by Andreas Galazis

Description: modified (diff)

comment:2 Changed 15 months ago by Tim Graham

Component: UncategorizedCore (Other)
Summary: Inline/Out of the box Type hints(PEP 484) and Variable annotations(PEP 526)Add typing hinting (PEP 484) and variable annotations (PEP 526)
Triage Stage: UnreviewedSomeday/Maybe

This is discussed on django-developers but a consensus on how to proceed hasn't emerged.

comment:3 Changed 15 months ago by Adam (Chainz) Johnson

Cc: Adam (Chainz) Johnson added

comment:4 Changed 15 months ago by Zach Borboa

Cc: Zach Borboa added

comment:5 Changed 15 months ago by Andreas Galazis

Summary: Add typing hinting (PEP 484) and variable annotations (PEP 526)Add type hints (PEP 484) and variable annotations (PEP 526)

comment:6 Changed 14 months ago by Vlastimil Zíma

Cc: Vlastimil Zíma added

comment:7 Changed 13 months ago by Brylie Christopher Oxley

I am available to help with this issue. Is there a checklist of files or areas, so that I can take a few to start?

comment:8 Changed 13 months ago by Tim Graham

See comment 2 and post on the mailing list if you want to try to get a consensus on a way forward.

comment:9 Changed 4 months ago by Sergey Kolomenkin

Are there any updates on this ticket?

Does Django has some roadmap for adding type hints support to Django?

comment:10 Changed 4 months ago by Tim Graham

No updates. The discussion is on the mailing list linked in comment 2.

Note: See TracTickets for help on using tickets.
Back to Top