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
{{ message }}
Repository navigation
UP047 Fails to indentify functions that have Callable in their signature #19863
There was a bug in collections.abc.Callable on Python 3.9 IIRC, which means it isn't safe to replace typing.Callable with collections.abc.Callable on all Python versions (it works most of the time on py39, but not in some edge cases, I think?)
Should be safe on the newest Python versions, though. Can't remember exactly when the bug was fixed
I talked to Alex, and I don't think that Python bug should affect this rule, which is only replacing the type of generics, not importing Callable from a different module. I believe he was thinking of deprecated-import (UP035), which will replace typing.Callable with collections.abc.Callable after Python 3.10.
Activity
MichaReiser commentedon Aug 11, 2025
Thanks for opening an issue. This was also discussed in our Discord (conversation).
Specifically, @AlexWaygood replied
ntBre commentedon Aug 11, 2025
I talked to Alex, and I don't think that Python bug should affect this rule, which is only replacing the type of generics, not importing
Callablefrom a different module. I believe he was thinking of deprecated-import (UP035), which will replacetyping.Callablewithcollections.abc.Callableafter Python 3.10.AlexWaygood commentedon Aug 11, 2025
Yup, @ntBre is correct — my bad! sorry about that 🫠
Deduplicate type variables in generic functions (#23225)
Deduplicate type variables in generic functions (#23225)