-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Make TC010 docs example more realistic #19356
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
Merged
Merged
+14
−3
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
MichaReiser
approved these changes
Jul 15, 2025
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.
Thank you
dcreager
added a commit
that referenced
this pull request
Jul 15, 2025
* main: [`pylint`] Extend invalid string character rules to include t-strings (#19355) Make TC010 docs example more realistic (#19356) Move RDJSON rendering to `ruff_db` (#19293) [`flake8-use-pathlib`] Skip single dots for `invalid-pathlib-with-suffix` (`PTH210`) on versions >= 3.14 (#19331) [`ruff`] Allow `strict` kwarg when checking for `starmap-zip` (`RUF058`) in Python 3.14+ (#19333) [ty] Reduce false positives for `TypedDict` types (#19354) [ty] Remove `ConnectionInitializer` (#19353) [ty] Use `Type::string_literal()` more (#19352) [ty] Add ecosystem-report workflow (#19349) [ty] Make use of salsa `Lookup` when interning values (#19347) [ty] Sync vendored typeshed stubs (#19345) [`pylint`] Make example error out-of-the-box (`PLE2502`) (#19272) [`pydoclint`] Fix `SyntaxError` from fixes with line continuations (`D201`, `D202`) (#19246)
dcreager
added a commit
that referenced
this pull request
Jul 15, 2025
* dcreager/merge-arguments: add types iterator add asserting constructor debug assert lengths remove unused From use FromIterator [`pylint`] Extend invalid string character rules to include t-strings (#19355) Make TC010 docs example more realistic (#19356) Move RDJSON rendering to `ruff_db` (#19293) [`flake8-use-pathlib`] Skip single dots for `invalid-pathlib-with-suffix` (`PTH210`) on versions >= 3.14 (#19331) [`ruff`] Allow `strict` kwarg when checking for `starmap-zip` (`RUF058`) in Python 3.14+ (#19333) [ty] Reduce false positives for `TypedDict` types (#19354) [ty] Remove `ConnectionInitializer` (#19353) [ty] Use `Type::string_literal()` more (#19352) [ty] Add ecosystem-report workflow (#19349) [ty] Make use of salsa `Lookup` when interning values (#19347) [ty] Sync vendored typeshed stubs (#19345) [`pylint`] Make example error out-of-the-box (`PLE2502`) (#19272) [`pydoclint`] Fix `SyntaxError` from fixes with line continuations (`D201`, `D202`) (#19246)
UnboundVariable
pushed a commit
to UnboundVariable/ruff
that referenced
this pull request
Jul 15, 2025
…finition * 'main' of https://github.com/astral-sh/ruff: (39 commits) [ty] Sync vendored typeshed stubs (astral-sh#19368) Fix typeshed-sync workflow (astral-sh#19367) Rework typeshed-sync workflow to also add docstrings for Windows- and MacOS-specific APIs (astral-sh#19360) [ty] Allow `-qq` for silent output mode (astral-sh#19366) [ty] Allow `-q` short alias for `--quiet` (astral-sh#19364) Add shellcheck to pre-commit (astral-sh#19361) distinguish references from definitions in `infer_nonlocal` [`pycodestyle`] Handle brace escapes for t-strings in logical lines (astral-sh#19358) [ty] Combine CallArguments and CallArgumentTypes (astral-sh#19337) Move Pylint rendering to `ruff_db` (astral-sh#19340) [`pylint`] Extend invalid string character rules to include t-strings (astral-sh#19355) Make TC010 docs example more realistic (astral-sh#19356) Move RDJSON rendering to `ruff_db` (astral-sh#19293) [`flake8-use-pathlib`] Skip single dots for `invalid-pathlib-with-suffix` (`PTH210`) on versions >= 3.14 (astral-sh#19331) [`ruff`] Allow `strict` kwarg when checking for `starmap-zip` (`RUF058`) in Python 3.14+ (astral-sh#19333) [ty] Reduce false positives for `TypedDict` types (astral-sh#19354) [ty] Remove `ConnectionInitializer` (astral-sh#19353) [ty] Use `Type::string_literal()` more (astral-sh#19352) [ty] Add ecosystem-report workflow (astral-sh#19349) [ty] Make use of salsa `Lookup` when interning values (astral-sh#19347) ... # Conflicts: # crates/ty_ide/src/goto.rs # crates/ty_server/src/server.rs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
I noticed this while reviewing #19100. The current example here is pretty confusing IMO: you'd never need to quote
int
in a type annotation, because it's always defined (it's a builtin!). Usually you quote annotations if they represent a forward reference to something defined later on. Also, the first "use instead" suggestion will only be valid if you also addfrom __future__ import annotations
to the top of the file; this makes that explicit