What's new in astroid 4.3.2?
Release date: 2026-09-25
Bug Fixes
-
Fix a crash when a
namedtupleorEnumtype name or field name
containsstr.formatmarkup, as innamedtuple("{0}", "abc"). The name
is interpolated into an error message that astroid then reformats, so
building the message raisedIndexError. Inference now falls back to its
default.Closes #3199
-
Infer a functional
TypeVarorNewTypewhose name is not an identifier
without splicing that name into the synthesized class source. A crafted value
such asTypeVar("T(Base): #")no longer breaks out of the identifier
position to inject bases or a body; the name is assigned to the class verbatim.Refs #3217
-
Raise
InferenceErrorinstead of crashing withIndexErrorwhen a class
usessix.with_metaclass()with no positional metaclass argument, both while
building the module and when the call is inferred.Refs #3248
-
ClassDef.slots()no longer crashes on a class that declares a PEP 695
type parameter literally named__slots__(e.g.class C[__slots__]:).
The type parameter'sTypeVarnode was mistaken for the class's actual
__slots__value;slots()now returnsNonefor such classes
instead of raisingAttributeError.Refs #3258
-
Fix a crash when inferring an f-string or
str.format()call whosecformat
spec gets an out-of-range code point, such asf"{-1:c}". These now infer to
Uninferable, like the%ccase fixed in #3254.Closes #3301
-
The
argsattribute of an exception instance is now inferred as atuple
instance of unknown contents instead of a known empty tuple, so unpacking
exc.argsno longer looks unbalanced.Closes pylint-dev/pylint#11312