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
Can't redefine name imported from another module #591
It should be possible to redefine a name imported from another module, at least in stubs. Currently mypy complains about the redefinition (at least often). We can treat this as an assignment and just verify that the types are compatible.
I couldn't easily come up with an example that would fail, so I'm closing this. If some special case is still failing we can create a separate issue about that special case.
Activity
gvanrossum commentedon Jan 27, 2016
(Another one related to #649.)
JukkaL commentedon May 17, 2018
I couldn't easily come up with an example that would fail, so I'm closing this. If some special case is still failing we can create a separate issue about that special case.
DanAlbert commentedon Mar 26, 2025
#1168 was duped into this which had an example:
It's still a problem with mypy 1.15.0. Is there a different way we should be writing code that relies on types from maybe-available packages?
DanAlbert commentedon Mar 26, 2025
Actually after commenting I see the case I'm running into is slightly different:
Which yields "All conditional function variants must have identical signatures", which is the same error, but possibly not the same problem.