[ty] correctly ignore field specifiers when not specified#20002
Merged
carljm merged 1 commit intoastral-sh:mainfrom Aug 20, 2025
Merged
[ty] correctly ignore field specifiers when not specified#20002carljm merged 1 commit intoastral-sh:mainfrom
carljm merged 1 commit intoastral-sh:mainfrom
Conversation
Contributor
Diagnostic diff on typing conformance testsNo changes detected when running ty on typing conformance tests ✅ |
Contributor
|
e06eb70 to
12d74fb
Compare
carljm
approved these changes
Aug 20, 2025
Contributor
carljm
left a comment
There was a problem hiding this comment.
This looks good to me, thank you!
Clearly when we add full field_specifiers support, we will probably replace/remove this simple boolean flag. But this improves the current behavior, and doesn't make the future changes more difficult.
@sharkdp are you okay with this temporary fix?
Contributor
|
Going to go ahead and merge this, it's a small PR, there's nothing here that we can't easily change again. Thank you for the fix! |
Contributor
Yes, of course. Thank you for this contribution! |
dcreager
added a commit
that referenced
this pull request
Aug 21, 2025
* main: (29 commits) [ty] add docstrings to completions based on type (#20008) [`pyupgrade`] Avoid reporting `__future__` features as unnecessary when they are used (`UP010`) (#19769) [`flake8-use-pathlib`] Add fixes for `PTH102` and `PTH103` (#19514) [ty] correctly ignore field specifiers when not specified (#20002) `Option::unwrap` is now const (#20007) [ty] Re-arrange "list modules" implementation for Salsa caching [ty] Test "list modules" versus "resolve module" in every mdtest [ty] Wire up "list modules" API to make module completions work [ty] Tweak some completion tests [ty] Add "list modules" implementation [ty] Lightly expose `FileModule` and `NamespacePackage` fields [ty] Add some more helper routines to `ModulePath` [ty] Fix a bug when converting `ModulePath` to `ModuleName` [ty] Split out another constructor for `ModuleName` [ty] Add stub-file tests to existing module resolver [ty] Expose some routines in the module resolver [ty] Add more path helper functions [`flake8-annotations`] Remove unused import in example (`ANN401`) (#20000) [ty] distinguish base conda from child conda (#19990) [ty] Fix server hang (#19991) ...
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
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.
This commit corrects the type checker's behavior when handling
dataclass_transformdecorators that don't explicitly specifyfield_specifiers. According to PEP 681 (Data Class Transforms), whenfield_specifiersis not provided, it defaults to an empty tuple, meaning no field specifiers are supported anddataclasses.field/dataclasses.Fieldcalls should be ignored.Fixes astral-sh/ty#980