-
-
Notifications
You must be signed in to change notification settings - Fork 968
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
chore: improve type hints #2867
base: master
Are you sure you want to change the base?
Conversation
Can we enforce those via ruff? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you can find ruff rules to enforce this behavior, I'm happy to accept it.
Run A mini demo to verify: # bb.py
import typing
from typing import Callable, ContextManager, Sequence
def foo(a: Callable, b: ContextManager, c: Sequence) -> tuple[typing.Sequence, typing.ContextManager]:
pass Run
Then run import typing
from collections.abc import Sequence
from typing import Callable, ContextManager
def foo(a: Callable, b: ContextManager, c: Sequence) -> tuple[typing.Sequence, typing.ContextManager]:
pass |
Yes, |
But you replaced everything in this PR manually... Right? The diff duplicated since last time I checked. |
While |
Summary
Only improve type hints, does not change any logic
ruff check --fix starlette tests
from typing import ContextManager
-->from contextlib import AbstractContextManager
Checklist