django-typed-models icon indicating copy to clipboard operation
django-typed-models copied to clipboard

Add type annotations

Open jacobjove opened this issue 2 years ago • 1 comments

jacobjove avatar Nov 25 '23 18:11 jacobjove

@craigds , I agree.

My understanding is that type stubs can be incrementally added to projects and distributed separately/independently from those projects. Looking into this, I found that it's not necessary to distribute stubs if you are willing to include type hints in the codebase: https://peps.python.org/pep-0561/#packaging-type-information

So if you're willing to include type hints in the codebase, that's preferable in my opinion.

We can add a file named py.typed to the source directory, and then that directory and its children should be analyzable by static type checkers.

Another reference: https://blog.whtsky.me/tech/2021/dont-forget-py.typed-for-your-typed-python-package/

jacobjove avatar Nov 27 '23 17:11 jacobjove