Add Typelets, a utility types library for Python and Django.
Review Request #14029 — Created July 11, 2024 and submitted
Typelets is a collection of types useful for working with Python
projects generally, and Django projects specifically. It's largely a
compilation of types that we've introduced in our other projects,
available in one place.The following modules are currently provided:
typelets.funcs
: Typing for general keyword arguments in functions.typelets.json
: Typing for JSON structures, and for application-defined
data that can be serialized to JSON.-
typelets.symbols
: Symbols for marking types as unset/unsettable. -
typelets.django.auth
: Types for accepting users. typelets.django.forms
: Types for forms and form fields.typelets.django.json
: Types for Django's JSON serialization.typelets.django.models
: Types for working with Django models.typelets.django.strings
: Types for localized strings.typelets.django.urls
: Types for URL management.
It's built to have very light-weight dependencies, and to be purely
opt-in. If a project doesn't use Django, it simply doesn't need to
import any of the Django libraries, for example.
Over time, we may add more to this module, covering Python, Django, and
perhaps other modules. The hope is that eventually we'll be able to
deprecate more of these as Python and Django's typing improve.
Tested all the types with some local dummy code, using
reveal_type()
and assignments to make sure the examples worked as expected.
Summary | ID |
---|---|
77260e7c774e4721806670c754b34f484434b34a |
- Change Summary:
-
Fixed the name of a module.
- Description:
-
Typelets is a collection of types useful for working with Python
projects generally, and Django projects specifically. It's largely a compilation of types that we've introduced in our other projects, available in one place. The following modules are currently provided:
typelets.funcs
: Typing for general keyword arguments in functions.
typelets.json
: Typing for JSON structures, and for application-defined
data that can be serialized to JSON.
-
typelets.symbols
: Symbols for marking types as unset/unsettable.
-
typelets.django.auth
: Types for accepting users.
typelets.django.forms
: Types for forms and form fields.
typelets.django.json
: Types for Django's JSON serialization.
typelets.django.models
: Types for working with Django models.
typelets.django.strings
: Types for localized strings.
~ typelets.django.url
: Types for URL management.
~ typelets.django.urls
: Types for URL management.
It's built to have very light-weight dependencies, and to be purely
opt-in. If a project doesn't use Django, it simply doesn't need to import any of the Django libraries, for example. Over time, we may add more to this module, covering Python, Django, and
perhaps other modules. The hope is that eventually we'll be able to deprecate more of these as Python and Django's typing improve. - Commits:
-
Summary ID ae3872a0cc4d969ecf9f4784862e47934fbeea63 ee2415c30c6c0c8bd2fc742413a23498347c2ba0