Join GitHub today
Improve Tuple/Sequence/Iterable overlapping #5315
Well, I'm not Ivan, but I'm also bored so here's a code review.
Apologies in advance if the review ended up being incoherent in places -- I'm sort of bouncing between different things atm.
@ilevkivskyi -- sure! I have to go to a thing, but I can re-run these tests a little later tonight.
@ethanhs -- I'm not sure if your PR will run into this case or not, but I remember running into this edge case while working on my other PR yesterday. Could you try checking to see what your PR does on this test case?
from typing import * # E.g. maybe this was imported from a non-typed module Parent: Any class Child(Parent): def some_method(self) -> int: if self is None: return None return 3
I believe the current behavior of mypy is to report no errors when running in strict-optional mode. If your PR complains about the "return None", you may have to swap out the two calls to
(The actual code that I synthesized this from does