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
We should update UP035 to emit a diagnostic if --target-version=py313 has been selected and a user imports typing.TypeIs, warnings.deprecated, typing.ReadOnly, typing.NoDefaulttyping.get_protocol_members or typing.is_protocol from typing_extensions rather than typing
We should emit an error if TypeVar, ParamSpec or TypeVarTuple is imported from typing_extensions and the script targets py313+ (but not if the script targets lower versions)
We should not emit an error if the script targets py312 or lower, and any of TypedDict, Protocol, runtime_checkable or get_type_hints is imported from typing_extensions. These all have their implementations from Python 3.13 backported in typing_extensions. (We currently do emit errors for all of these; this is a false positive.)
Lastly, for (Async)Generator and (Async)ContextManager, we should recommend for the user to import them from collections.abc or contextlib rather than typing_extensions on Python 3.9-3.12 (and not emit a diagnostic at all on Python <=3.8). Currently if we see a user importing then from typing_extensions, we tell the user to import them from typing instead, but that's no longer a good suggestion. The typing_extensions versions backport the typing versions from Python 3.13, but on Python 3.9-3.12, the collections.abc/contextlib versions should still be a dropin replacement.
We should update UP035 to emit a diagnostic if
--target-version=py313
has been selected and a user importstyping.TypeIs
,warnings.deprecated
,typing.ReadOnly
,typing.NoDefault
typing.get_protocol_members
ortyping.is_protocol
fromtyping_extensions
rather thantyping
Originally posted by @AlexWaygood in #11411 (comment)
The text was updated successfully, but these errors were encountered: