Jukka Lehtosalo

Results 479 comments of Jukka Lehtosalo

This was on my radar early in mypy development. I didn't work on this back then because this is a tricky feature. For example, if module `x` has `A.register(B)`, it...

It seems likely that mypy will support structural subtyping before it supports registering ABCs. Structural subtyping/protocols can be used for a similar effect, but that should be easier to implement....

Yeah, this can be a problem. I'm tagging this as feature, since mypy is working "as designed", though here the behavior is not what is expected. The narrowing behavior has...

Marking as high priority, since this can make us worse than CPython. Example where this matters: ```py def f() -> int: x = [1, 2, 456] ... ```

Integer and string literals are read from statics, but the remaining optimizations are still missing.

Actually, I'm no longer convinced that this is a bug. Turning this into an enhancement proposal.

Postponing this as I'm not sure if this is a good idea but might still be worth considering.

This is follow-up to #982.

Decreased priority since this doesn't seem like users often struggle with this -- it's easy enough to work around by inserting type annotations.

Updated priority to high.