-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Write about experience of dropping Python 2 and using MyPy #2468
Comments
Yeah, I should probably write something up about these, especially the latter. A short version for now:
It's significant that I dropped Python 2 before adding mypy annotations. In theory, adding mypy annotations in Tornado 2.0 before I started adding Python 3 support (if I'm remembering my version numbers correctly) would have helped that process. In practice, I'm not sure. The type signatures of functions in the Python 2/3 hybrid versions of Tornado were very complex. I needed the simplification of dropping Python 2 (and callbacks) to make the addition of type hints tractable. The biggest surprise in this process is that I'm not even sure that having mypy annotations would have let me avoid writing the comprehensive test suite. The test suite has been an aid to discovering the types of my functions as I attempt to write them down for mypy (although not so much the parts of the test suite that just do a bunch of type assertions). Even then I'm not sure that my type annotations are correct, which is an odd thing to say (Does this function take a |
To hijack this a little bit, what do you think about adding Tornado to the list of projects here? |
I think it's a good idea and mentioned it in python3statement/python3statement.github.io#21 (comment) but never got around to making a PR. |
I could make a PR if you're OK with that. |
@mivade Oops, missed this. Yes, feel free to go ahead and make a PR for the python 3 statement. |
Yes, I plan to distribute the type annotations. I'm not up to date on the relevant PEPs, but it sounds like adding that |
@bdarnell I somehow missed your missing my comment, but I've made the PR now! |
See discussion here: tornadoweb/tornado#2468
Closing this since I don't think I have any more to say here than the above comment. |
In perusing old issues I saw two things that interested me:
I'm curious to learn more about the costs and benefits of taking these steps within a project like Tornado. I also think that I'm not alone in this curiosity. I encourage the maintainers of Tornado to write about the experience after it is done.
This isn't really an issue with Tornado, and is more a suggestion of a community activity. Please feel free to close if this is not the appropriate venue for this kind of request.
The text was updated successfully, but these errors were encountered: