Skip to content

RBerga06/python-descriptor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to correctly type descriptors in Python.

This approach is 100% supported by the pyright type checker.

Have a look at the Python files in this repo:

  • descriptor.py contains the definition of all descriptor protocols
  • property.py contains a redefinition of Python's builtin property type, but it's correctly typed.
  • usage.py contains some examples

[!WARNING] Everything here needs Python 3.13 installed (e.g. pyenv install 3.13-dev) to work correctly. If you need it in an older Python version, simply use the old TypeVar syntax.

About

How to correctly type-annotate Python descriptors

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages