1. 15

I am looking for large Python projects that have completed transition to the type system successfully. So far, I know about urllib3, and w3lib. I also know about typeshed. Which others? And any observations from those who attempted the transition?

  1. 14

    Flask recently added type stubs, around the time 2.0 was being released. Turns out it was rather easy(?) because it didn’t take that long, was done by a single contributor and took 800 lines of type hints.

    As for my experience with adding types to a project, it’s usually fairly seamless, and more often than not, you’ll end up finding subtle bugs in your code instead of the type checker getting in the way.

    1. 1

      Thanks! Much appreciated.

    2. 6

      Zulip project is using mypy since 2016 and has around ~1600 files.

      1. 1

        Thank you!

      2. 2

        pip is pretty heavily annotated, though not 100%

        1. 1

          Thanks! I will check that out.

        2. 1

          Not open source and I’m not able to confirm this personally but instagram?

          1. 1

            Thanks! I want to have a look at the commits at least, so I can see what kind of discussions took place.

          2. 1

            I’m curious on why you are asking. Having the project contributors’s buy in and commitment is really essential to success. For a large project, consider how Dropbox completed type checking across most of its Python code.

            https://dropbox.tech/application/our-journey-to-type-checking-4-million-lines-of-python

            1. 1

              I want to know what decisions were made in the process. For example, how far did you go in converting certain data structures to use types, and where did you leave it for future (or never), and why, how much of the project were you able to convert, did it result in some of the tests being removed/added?.

              1. 1

                I see. I’ve only converted small projects with less than 50 files. I was able do conversions one package at a time and complete the conversion over a period of multiple commits.

                1. 1

                  Thanks! Do you have these project repositories online somewhere?