Update dependency ty to v0.0.35#37
Merged
Merged
Conversation
Test Results
|
5996bc6 to
506d41a
Compare
506d41a to
f453961
Compare
f453961 to
129e074
Compare
129e074 to
f6ce430
Compare
8be733c to
4858c1f
Compare
4858c1f to
557c4ca
Compare
557c4ca to
710ead3
Compare
710ead3 to
1c1d4ea
Compare
92c4f7c to
d2b3975
Compare
d2b3975 to
30c28b4
Compare
1390235 to
25f949f
Compare
abb7e53 to
c4450e6
Compare
c4450e6 to
6571a1a
Compare
6571a1a to
a0333a6
Compare
a0333a6 to
da9592c
Compare
da9592c to
b877317
Compare
b877317 to
2d80a3a
Compare
2d80a3a to
75b2004
Compare
75b2004 to
e8d4b11
Compare
e8d4b11 to
9827726
Compare
9827726 to
f2c0f67
Compare
f2c0f67 to
0d638d1
Compare
0d638d1 to
98ba406
Compare
98ba406 to
6dd7568
Compare
6dd7568 to
f3b68e4
Compare
f3b68e4 to
678fef7
Compare
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 PR contains the following updates:
==0.0.1a25→==0.0.35Release Notes
astral-sh/ty (ty)
v0.0.35Compare Source
Released on 2026-05-10.
Bug fixes
LSP server
CLI
Core type checking
__class__checks (#24997)Diagnostics
Performance
Contributors
v0.0.34Compare Source
Released on 2026-05-01.
Bug fixes
LSP server
Annotatedmetadata in semantic tokens (#24890)Core type checking
functools.partial(#24582)TypeIsassignability with gradual types (#24928)dict(**TypedDict)inTypedDictcontext (#24709)infer_variancefor legacyTypeVar(#24930)ParamSpec(#24927)UnionofTypedDictin various sites (#24958)Diagnostics
Performance
Contributors
v0.0.33Compare Source
Released on 2026-04-28.
Notable changes
ty now prefers the declared type of an annotated assignment in more situations (#24802).
Consider this example:
ty previously favored the inferred type of the right hand side expression when
thresholdandresultwere used. This is useful forthreshold, as it allows something likethreshold += 1to work without an error: we know thatthresholdcould later becomeNone, but right now, we see that it is anint. However, forresult, the inferred type isUnknown. This is not a useful type and it can lead to false negatives. Starting with this release, ty will therefore preferthe declared type if the inferred and declared types are mutually assignable. In the above example,
thresholdwill still be inferred asint(or ratherLiteral[1]), butresultwill now be inferred asstr. If you previously addedcasts to work around this behavior, you should be able to remove them after upgrading.Bug fixes
LSP server
Core type checking
finallyblocks where alltry/exceptblocks are terminal (#24882)ClassVarvs instance-attribute overrides (#24767)Unpack[...](#24868)Callabletype context (#24317)**unpacking ofTypedDictin dict-literal assignments (#24703)Unpack[TypedDict]in**kwargssignatures (#24653)[*xs]as an irrefutable pattern when matching onSequence(#24787)Diagnostics
invalid-return-typediagnostics,invalid-yielddiagnostics, attribute assignment diagnostics (#24770, #24771)dictassignment error diagnostics (#24768)invalid-keydiagnostics for unions of TypedDicts (#24693)invalid-type-formdiagnostics for PEP-613 type alias values (#24760)Performance
Other changes
Contributors
v0.0.32Compare Source
Released on 2026-04-20.
Bug fixes
__get__usesConcatenateself-type and wraps a__call__(#24692)Callabletype context (#24661)LSP server
@overload-decorated function has no docstring (#23920)Core type checking
ifstatements in TypedDict bodies (#24702)@disjoint_baseon TypedDicts and Protocols (#24671)@dataclass_transform-decorated class to have dataclass-like semantics if it hastypein its MRO (#24679)Neversetters or deleters (#24510)Diagnostics
Performance
Contributors
v0.0.31Compare Source
Released on 2026-04-15.
Bug fixes
namedtuple(typename=T, field_names=x, **{})(#24641)Enum(...)names (#24638)Enum(value=...)(#24639)invalid-keyfix doesn't converge, andoverride-of-final-methodproduces invalid syntax (#24649)ty:ignorecomments inserted by--add-ignorefor diagnostics starting on the same line (#24651)CLI
--fixmode to enable auto-fix for diagnostics (#24097)Performance
Core type checking
NamedTuplefield conflicts (#24542)EnumMeta.__call__for enum constructor signatures (#24513)Contributors
v0.0.30Compare Source
Released on 2026-04-13.
As of v0.0.30, ty no longer unions
Unknowninto most inferred types of unannotated attributes. For example:In previous versions,
reveal_type(Foo().value)would have includedUnknown, so the assignment to"x"would not have been flagged. Since this can affect inferred attribute types throughout a codebase, upgrading may lead to both new and resolved diagnostics. Initializers ofNoneand other non-literal singleton types remain exceptions. See #24531 for details.Bug fixes
ParamSpecinConcatenateprefixes (#24474)Callabletypes (#24497)TYPE_CHECKINGstate from outer blocks (#24470)__init_subclass__calls (#24541)type[T]to a metaclass (#24515)ParamSpec-specialized class calls (#24399)TypedDictfield types as type context to inform the inference of arguments passed toTypedDictconstructors (#24422)LSP server
typingandcollectionshigher than third party re-exports (#23643)TypedDictconstructor support in the LSP by synthesizing__init__(#24476, #24522, #24535)infosubdiagnostics in LSP diagnostic messages (#24328)Diagnostics
Core type checking
Enum(...)syntax (#23602, #24570, #24571)Finalvariable assignments in__post_init__(#24529)type[...]annotations, e.g.type["MyClass"](#24518)__init_subclass__ = None(#24543)TypeGuardandTypeIsnarrowing for unbound method calls (#24612)list[int][0]leads to 1 diagnostic, rather than 2 (#24354)dataclass_transformmetadata from metaclass bases (#24615)Noneaccessors in manual property construction (#24492)Finalattributes (#24508)TypedDictunpacking (#24446)strconstructor (#24514)Unknowninto types of un-annotated attributes (#24531)super()in metaclass methods (#24483)Concatenatetype-expression parsing (#24172)if TYPE_CHECKINGblock (#24394)Contributors
v0.0.29Compare Source
Released on 2026-04-05.
Bug fixes
dataclasses.fieldif it's not infield_specifiers(#24397)environment.python-versionvalues in configuration files (#24402)requires-python(#24401)Core type checking
types.new_class(#23144)withstatement (#24395)__new__and metaclass__call__return types (#24357)Contributors
v0.0.28Compare Source
Released on 2026-04-02.
Bug fixes
LSP server
Core type checking
extra_itemskeyword argument to class-based TypedDicts as an annotation expression (#24362)x: list[int | None] = [None] * 2(#24197)infer_type_expressionfor parsing parameter annotations and return-type annotations (#24353)infer_type_expressionfor validating PEP-613 type aliases (#24370)extra_itemskeyword to functional TypedDicts (#24360)TypedDicts (#24345)Contributors
v0.0.27Compare Source
Released on 2026-03-31.
Bug fixes
list[int]<CURSOR>()(#24167)list[Annotated[()]](#24303)type A = TypeIs[Callable[[], A]](#24245)_clsas the name of the first argument for synthesizedcollections.namedtupleconstructor methods (#24333)LSP server
Core type checking
get()defaults (#24231)pop()defaults (#24229)Finalattribute assignment rules for annotated and augmented writes (#23880)Callabletype context (#23888)Callabletype context (#22633)awaitexpressions (#24256)Finalwhen emitting a diagnostic about aFinalvariable being reassigned (#24194)Contributors
v0.0.26Compare Source
Released on 2026-03-26.
Bug fixes
Core type checking
typing.Concatenate(#23689)converters (#23088)Selfin metaclass and static methods (#23231)dict()(#24103)dataclass_transformparams (#24170)Performance
Literaltype(#24185)Contributors
v0.0.25Compare Source
Released on 2026-03-24.
Breaking changes
type:ignore[ty:code]suppressions (#24096)Bug fixes
TypedDict | dictunions (#24151)NewTypes of unions vs. unions (#24087)N & ~TtoNeverifB & ~Twould simplify toNever, whereBis the concrete base type of aNewTypeN(#24086)LSP
Type checking
TypedDictupdate (#24101)TypedDictupdates (#24128)reveal_typediagnostics in unreachable code (#24070)isinstance()reachability analysis (#24077)yieldexpression types (#23796)invalid-metaclass(#24145)Never(#24056)Contributors
v0.0.24Compare Source
Released on 2026-03-19.
Bug fixes
TypedDictsubscripts for unknown keys returnUnknown(#23926)TypeIs(#23784)LSP server
Core type checking
/usr/local/libdist-packages on Debian/Ubuntu (#23797)v0.0.23Compare Source
Released on 2026-03-13.
Bug fixes
from __future__ import annotationsis active (#23915)dataclass_transform: Respectkw_onlyoverwrites in dataclasses (#23930)Literaltypes (#23875)Server
#(#23831)Core type checking
possibly-missing-submoduleerror code (enabled by default), and makepossibly-missing-attributeignored by default (#23918)Improvements to diagnostics
from __future__ import annotationsonly stringifies type annotations (#23928)Performance improvements
Contributors
v0.0.22Compare Source
Released on 2026-03-12.
Bug fixes
Divergentif they were assigned using tuple unpacking in loops (#23812)error = "all"in a rootpyproject.tomlfile to be overridden usingtool.ty.overridesin a subdirectory'spyproject.tomlfile (#23712)type[]types to their constructorCallabletype during assignability checks, not during redundancy/subtyping checks (#23834, #23901)LSP server
CLI
ty explain <RULE>CLI command (#23766)Core type checking
TypeVarTupleparameters (#23807)LiteralStringto be narrowed using equality checks (#23794)types.ModuleType(#23786)__setitem__dunder calls (#23800)t | {"foo": int}asTDiftis an instance of a TypedDicttdwith afoo: intkey (#23806)TtoT & strrather thanstrifTis a constrained TypeVar withstras one of its constraints (#23850)NonetoNone | Unknownin invariant contexts (#23790)type[Callable]in type annotations (#23753)T & ~Sis always inferred as a subtype ofUduring generic inference ifTis understood as a subtype ofU(#23728)Installer
Contributors
v0.0.21Compare Source
Released on 2026-03-05.
Bug fixes
*argsunpacking into optional positional parameters (#23124)Anyattributes withobjectafterisinstancenarrowing (#23725)LSP server
Configuration
allselector toty.jsonschema (#23721)allselector in TOML configurations (#23723)allselector case-sensitive (#23713)Type checking
invalid-enum-member-annotationlint rule (#23648)TypeVaris used to specialize aParamSpec, or vice versa (#23738)Unknowninto unannotated container types (#23718)nameandvalueof an enum (#23683)Callable(#23625)Contributors
v0.0.20Compare Source
Released on 2026-03-02.
Bug fixes
isinstance()orissubclass()checks involvingtype[]types (#23598)NewTypeoffloatand an instance ofAny/Unknown(#23620)Callablewith a variadic positional parameter could be a subtype of aCallablewith a positional-or-keyword parameter (#23610)t.__mro__iftis an instance oftype[Any](#23632)Callabletargets (#23277)python -m tyworks even when ty was installed into an ephemeral virtual environment (#2852)LSP server
Type checking
P.argsandP.kwargs(#23640)Required/NotRequired, and ban them both outside ofTypedDictfields (#23627)@finalon non-methods (#23604)Unpackwhen used with tuple types (#23651)isinstance()andissubclass()(#23607)Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.