The mypy bug that just kept on giving

I have the questionable honor of having, back in 2017, filed the third-most commented ever bug of mypy (#3186) (And the two more commented ones seem a lot more … complicated).

The story is as follows: I was beginning to test mypy for a project and had used the numbers.Number type for a variable, wanting to express that it contains a number.

Then I went and assigned IIRC 5 to it. Boom - incompatible types in assignment. Whoa.

Trying to be a good open-source citizen, I promptly filed an issue about this and that issue turned out to be quite something. Before it was finally closed in 2023, the ensuing discussion was epic, involving Guido van Rossum himself and other python luminaries. I checked back every once in a while over the years to see how it was going and to see which direction the discussion was headed at that point (there were a number of different solutions proposed and counterargued during that time).

After it was resolved, I didn’t think about it for a long time but recently I was tickled when I saw a link to my bug on the jaxtyping FAQ. (I have been using Patrick’s jax packages for a while now - equinox is a true masterpiece)




Enjoy Reading This Article?

Here are some more articles you might like to read next:

  • Getting into coding with LLMs; Nebius onboarding is lovely