You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reuse functools.cached_property definition instead of defining our own (typeddjango#1771)
Mypy has special handling for functools.cached_property, making it compatible with classvars and the @Property decorator (mypy-play example). But this handling did not extend to our django.utils.functional.cached_property.
By simply re-exporting functools.cached_property, we can piggyback on the already existing infrastructure in typeshed/mypy.
Note that typeshed did not define functools.cached_property on Python 3.7 and older. So this will break for users of older Python versions. But I think that's fine since we advertise 3.8 as the minimal Python version.
0 commit comments