]> git.ipfire.org Git - thirdparty/tornado.git/commit
typing: Eagerly import all submodules in __init__.pyi 3248/head
authorBen Darnell <ben@bendarnell.com>
Sat, 8 Apr 2023 19:42:05 +0000 (19:42 +0000)
committerBen Darnell <ben@bendarnell.com>
Sat, 8 Apr 2023 19:42:05 +0000 (19:42 +0000)
commit7c842b473cc5f5b3dd1d8f780f4fb27f32223d74
tree285ce6b679620cf465113ddff0e31f96d55a87da
parentd369a78fc1aca3d052a1b097b6fa93c10bd5b2f3
typing: Eagerly import all submodules in __init__.pyi

This makes the auto-import functionality compatible with mypy
and other typing-based tools such as autocomplete functionality.
Excluding these imports from static typing feels like a premature
optimization and made it much less appealing to make use of the
auto-imports.

This may slow down type checking of applications that use Tornado by
a little, since the type checker must now process all of Tornado and
not only the subset that was imported. However, the increasing use
of long-lived daemons for type checkers should mitigate this cost.
docs/releases/v6.3.0.rst
tornado/__init__.pyi [new file with mode: 0644]
tornado/test/import_test.py
tornado/web.py
tornado/websocket.py