Skip to content

chore(deps): update dependency astroid to v4 - #362

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/astroid-4.x
Open

renovate[bot] wants to merge 1 commit into
mainfrom
renovate/astroid-4.x

Conversation

@renovate

@renovate renovate Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Note

This PR body was truncated due to platform limits.

This PR contains the following updates:

Package Change Age Confidence
astroid ==3.3.11 → ==4.4.0 age confidence

Release Notes

pylint-dev/astroid (astroid)

v4.4.0

Compare Source

What's new in astroid 4.4.0?

Release date: 2026-11-30

Breaking Changes

  • Support for Python 3.10 was dropped, along with the PY311_PLUS constant and the
    typing-extensions runtime dependency. Python 3.11 is now the minimum version.

    Closes #​3375

New Features

  • t-strings (TemplateStr) are now inferred: a t-string is inferred as
    an instance of string.templatelib.Template and an interpolation field as an
    instance of string.templatelib.Interpolation. Their members are
    reconstructed from the actual template contents, so Template.strings /
    values / interpolations and Interpolation.value / expression /
    conversion / format_spec infer to the same values as at runtime,
    including inside a called function, and adding two t-strings infers to the
    concatenated template. A Template or Interpolation built by calling the
    class directly is still a plain instance with uninferable members. The
    standard library defines those classes via type(t"..."), which is not
    statically inferable, so a brain plugin rebuilds the real classes from the live
    objects. as_string now also escapes literal braces and quotes in the
    constant parts of a t-string so the rendered code round-trips.

    Closes #​2789

  • Inference now narrows values through conditions joined by and and or.
    A variable tested by several constraints at once, as in
    if isinstance(apple, int) and apple != 3, keeps only the values satisfying
    every operand, and the or and negated forms are handled too. Inference stays
    conservative when an operand cannot be inferred or does not constrain the
    variable.

    Closes #​2977

  • When --prefer-stubs is enabled in Pylint, .pyi stub files are now loaded
    and used during inference, and compiled extensions with an adjacent stub use
    the stub instead of runtime introspection. Stub functions whose bodies contain
    only ..., pass, or a docstring infer the return type from the annotation.

    Closes #​3078

  • Inference now narrows values through the preceding operands of and and
    or. In x is not None and x, the last x no longer infers None.
    In x is None or x, the last x is only evaluated when x is None is
    false, so that condition is applied inverted. Constraints from several
    preceding operands, including nested boolean operations, are combined.

    Refs #​3101
    Refs pylint-dev/pylint#1498

  • Add a brain for numpy.dtypes, whose DType classes (StringDType, Float64DType, ...) NumPy attaches at import time, so they can now be inferred. Each class gets its own constructor rather than numpy.dtype's (obj, align, copy), so pylint no longer reports no-member on them nor no-value-for-parameter / unexpected-keyword-arg on calls such as StringDType(na_object=None).

    Closes #​3289
    Refs pylint-dev/pylint#9956

  • Inference now narrows values through conditions negated with not.
    not isinstance(x, int), not (x is None) and
    not (isinstance(x, int) and x == 3) used to constrain nothing; they now
    behave like the inverted condition in if statements, conditional
    expressions, comprehensions and boolean operations.

    Refs #​3368
    Refs pylint-dev/pylint#8331

  • Inference now narrows values after guard statements. After
    if x is None: return, x no longer infers None, and
    assert isinstance(x, int) keeps only the int values of x for the
    code after it. An if is a guard when its body ends with return,
    raise, continue or break. An assignment between the guard and the use
    is not narrowed, and neither is a function, lambda or class defined after the
    guard.

    Refs #​3369
    Closes pylint-dev/pylint#9809

  • Inference now narrows values after an if whose body assigns the name. After
    if x is None: x = [], x no longer infers the None it had before the
    if. This works for names and attributes, such as self.x or cls.x, with
    any condition that inference already narrows on.

    Refs #​3387
    Closes pylint-dev/pylint#5085
    Closes pylint-dev/pylint#4121
    Closes pylint-dev/pylint#3045
    Closes pylint-dev/pylint#2855

  • Inference now narrows values with callable(x) conditions. After
    if callable(x):, x no longer infers values that cannot be called, and
    after if not callable(x): it no longer infers values that can.

    Refs #​3391
    Refs pylint-dev/pylint#1493

Bug Fixes

  • Keep applying subsequent transforms when a transform returns None, preserving
    the current node instead of stopping the transform chain.

    Closes #​809

  • Infer list augmented concatenation with a tuple as a list, rather than Uninferable.

    Closes #​1865

  • dataclass_transform() now always returns the transformed ClassDef node so
    subsequent Enum inference still populates __members__ on @dataclass(init=False)
    and custom-__init__ enum classes.

    Refs #​2317

  • Add support for NumPy 2.x, fixing false positives when analyzing
    code that uses NumPy 2.

    Closes #​2710

  • dataclasses.replace(obj, ...) is now inferred as an instance of obj's own
    class instead of being inferred through the stdlib body of replace(). That body
    resolves obj.__class__ through the metaclass chain, which fails when a base is a
    subscripted generic such as Base[T]: the call became Uninferable with the
    old-style Generic[T] syntax, and resolved to the wrong class with PEP 695
    class Base[T] syntax. The concrete caller type is now propagated correctly,
    including through Self-annotated method chains.

    Refs #​3061

  • Fix inference of callable instances stored as attributes, including attributes
    with a same-named member on the callable. Infer the result of calling the
    instance instead of looking up the attribute name on it again.

    Refs #​3077

  • modutils.get_source_file no longer returns a compiled module as if it were
    source. Bytecode (.pyc/.pyo) and binary extension modules
    (.so/.pyd/.dll) now fall through to the regular stub/source lookup,
    so a .pyi stub sitting next to a compiled module is found again instead of
    the compiled file being handed back and then parsed as source.

    Closes #​3087

  • Require a C extension to be located in the standard library before its
    standard library name allows it to be imported. A name such as colorsys
    was trusted on its own, so an extension of that name sitting next to the
    analysed sources was imported, and its module initialisation run, without
    being on extension-pkg-allow-list. Extensions shipped with the
    interpreter are unaffected.

    Refs #​3193

  • Do not infer a functional Enum whose class name is not a string. Such a
    definition is invalid at runtime and could expose a non-string class name to
    consumers.

    Refs #​3212
    Refs pylint-dev/pylint#11229

  • modutils.module_in_path no longer reports a module as living under a
    directory when its path only shares a leading name with that directory, such as
    a module in proj_extra matching the path proj. It now uses the same
    separator-aware containment check as _get_relative_base_path.

    Refs #​3223

  • as_string() no longer renders an f-string whose delimiter reappears
    unescaped in its body. Such an f-string terminated early and either failed to
    parse or reparsed to a different expression, which matters because
    brain_dataclasses and brain_namedtuple_enum reparse as_string()
    output.

    Refs #​3235

  • as_string() no longer raises ValueError on an integer constant too
    large to repr() (past sys.get_int_max_str_digits()); such integers are
    rendered as hex literals instead. This crashed the dataclass transform when a
    field was shadowed by a property returning e.g. 10 ** 5000.

    Refs #​3236

  • The fallback __new__ of the object model, used when the real one cannot be found
    (instance.__new__, super().__new__(cls) under an uninferable ancestor, or the
    __new__ of a C type outside builtins), now has the signature
    (cls, *args, **kwargs) instead of (self, cls). Since __new__ takes the
    class explicitly, the old signature reported the class argument as missing and any
    other argument as unexpected.

    Closes #​3237
    Closes pylint-dev/pylint#8325
    Refs pylint-dev/pylint#10670

  • Fix a crash when inferring a super() call inside a function that is decorated
    with @classmethod but is not defined inside a class.

    Refs #​3240
    Closes pylint-dev/pylint#8755

  • AsStringVisitor no longer lets a docstring break out of the triple-quoted
    literal it is rendered into. A docstring value containing """, ending in a
    quote, or holding a NUL byte previously closed the literal early or, through the
    DOC_NEWLINE sentinel, injected extra lines into as_string() output, which
    the dataclass and namedtuple brains reparse. Such values now fall back to
    repr so the output round-trips.

    Refs #​3249

  • Infer a str/bytes old-style % interpolation without crashing when a
    %c conversion receives an out-of-range code point, such as "%c" % 0x110000
    or b"%c" % 256. The evaluation now catches OverflowError and yields
    Uninferable, matching the other invalid interpolations.

    Refs #​3254

  • Infer an enum member whose integer value is past the int-to-str conversion
    limit, such as A = 0xff... (a large hex literal the tokenizer accepts).

    Refs #​3256

  • Fix an AttributeError crash when inferring a typing.NamedTuple subclass
    or an enum.Enum whose body contains an assignment target that is not a plain
    name, such as the annotation a.b: str or the chained assignment x = a.b = 1.
    Such targets do not name a field or member and are now skipped.

    Closes #​3257

  • brain_gi only imports gi for a bare require_version(...) call when the
    name actually resolves to gi, no longer for an unrelated function of that name.

    Refs #​3277

  • The numpy brain no longer imports numpy to find out its version but reads
    from the installed package metadata instead.

    Refs #​3308

  • Fix an IndexError crash when inferring a functional enum.Enum call
    whose member list contains an empty tuple, such as enum.Enum("E", [()]).
    Such an invalid member now degrades to Uninferable instead of raising.

    Refs #​3332

  • Fix TypeError in FunctionDef.infer_call_result for a function named
    with_metaclass when the caller is a function, such as the decorator's
    parent while inferring FunctionDef.type.

    Closes #​3336

  • A class attribute is now inferred with the values assigned to it through the
    class in the module that defines it, as in cls.attr = value in a class
    method or Klass.attr = value, along with the value set in the class body.
    Only the latter used to be inferred, so pylint reported
    unsubscriptable-object, unsupported-membership-test and similar errors
    on lazily initialized class attributes such as cache = None. A value
    assigned to an attribute of a parent class also no longer leaks into a
    subclass that assigns the same attribute in the same scope.

    Refs #​3351
    Closes pylint-dev/pylint#9250
    Closes pylint-dev/pylint#9809
    Closes pylint-dev/pylint#10082
    Refs pylint-dev/pylint#3045

  • Fix an AssertionError when inferring a namedtuple, or a class derived from
    typing.NamedTuple, if collections.namedtuple itself cannot be inferred.
    The namedtuple is now built as if rename=False.

    Refs #​3352

  • Fix TypeError in ClassDef.ancestors() when typing.Tuple or
    typing.Callable is first inferred with an exhausted inference context.
    The synthesized class was built with an uninferable base and reused for
    every later inference.

    Closes #​3366

  • Fix a crash when inferring an attribute that resolves to a method proxying
    something other than a function.

    Refs #​3370
    Refs pylint-dev/pylint#10345

  • Add a name to Slice nodes, giving "slice" like other inferred builtin
    values (Const, List, Dict...) give the name of their type. A slice
    object used as a class base, metaclass, exception or super() argument no longer
    crashes code that reads the name of an inferred value.

    Unknown nodes now have a pytype() too, like their name and qname(),
    so every value inference returns can be asked for its name, qualified name and type.

    Refs #​3373
    Refs pylint-dev/pylint#11609

  • Infer the name bound by a type statement as a typing.TypeAliasType
    instance instead of the aliased value, so __value__ and the other alias
    attributes are found on it.

    Refs #​3374
    Refs pylint-dev/pylint#10091

  • Fix an uncaught TypeError when inferring a starred name nested in a
    for target, such as for a, (b, *c) in ..., over an element the
    inference cannot see into.

    Closes #​3378

  • Do not cache inference results that were truncated by the inference budget.
    Caching them made inference results depend on the order in which modules were analysed.

    Closes #​3383
    Closes #​3464
    Closes pylint-dev/pylint#11582
    Refs pylint-dev/pylint#9549

    Thanks to @​budhitha for the astroid-only reproducer behind #​3464.

  • Prevent a TypeError in infer_typing_alias when _alias() is called with
    a non-integer constant second argument.

    Closes #​3389

  • Source files are now closed when reading fails during module building.

    Closes #​3404

  • FunctionDef.getattr() and Lambda.getattr() no longer add the special
    attribute to instance_attrs when an attribute such as __name__ is both
    assigned on the function and a special attribute. The stored list used to grow by
    one on every lookup. ClassDef.repr_tree(ast_state=True) no longer raises
    AttributeError.

    Refs #​3411

  • Fix a crash when inferring len() on an instance whose __len__ is not
    callable, such as a module. The call is now uninferable instead.

    Refs #​3426

  • Fix AttributeError when calling qname() on a generator expression or a
    list, set or dict comprehension. They are now named <genexpr>, <listcomp>,
    <setcomp> and <dictcomp>, like <lambda>, which also shows in their repr.

    Refs #​3427

  • Stop inferring a __get__ attribute on generators, which are not
    descriptors. Accessing it is now reported as no-member, like the
    AttributeError at runtime, instead of crashing attribute inference.

    Refs #​3428

  • Fix AttributeError when inferring the call result of a subclass of
    type without a caller.

    Refs #​3429

  • ClassDef.has_dynamic_getattr() now always returns a bool. It returned
    Uninferable when the __getattr__ of a metaclass could not be inferred.

    Refs #​3430

  • modpath_from_file() no longer raises ImportError for a module inside a namespace
    package that also exists in site-packages: the namespace package is now looked up from
    the directory the module is resolved from.

    Refs #​3445
    Refs pylint-dev/pylint#10278

  • Fixed isinstance() and issubclass() inference constraint when the classinfo is a
    PEP 604 union, e.g. isinstance(x, int | str).

    Refs #​3453

  • Apply the !s, !r and !a conversions when inferring f-strings, so
    f'{"a"!r}' is inferred as "'a'" instead of 'a'.

    Refs #​3461

  • Infer names bound by an import in an enum class body as enum members, like
    assigned names, instead of as the plain imported object.

    Refs #​3466
    Closes pylint-dev/pylint#10951

  • Do not treat values wrapped in enum.nonmember() as members of the enum.
    They were listed in __members__, so pylint reported invalid-enum-extension
    when such a class was extended, for example on any Django 6 models.Choices
    subclass.

    Closes #​3467
    Refs pylint-dev/pylint#6887

  • Fix a hang when inferring a class whose __bool__ reads attributes that are
    narrowed by a truthiness guard (if self.left:). The truthiness constraint
    now passes the inference context to bool_value(), so the recursion guard
    applies.

    Refs #​3473
    Closes pylint-dev/pylint#11807

  • Only treat a function as a property because of its decorator's name, like
    @lazy or @reify, when the function is defined in a class body. A
    function decorated this way elsewhere stays a function, so it is no longer
    inferred as a property object that is not callable.

    Refs #​3475
    Closes pylint-dev/pylint#3586

  • typing.NamedTuple is now inferred as a tuple subclass with _asdict,
    _replace, _fields, _make and _field_defaults, as typeshed
    declares it. self in a method of a typing.NamedTuple subclass finds that
    API and the tuple methods such as count and index through it, so pylint
    no longer reports no-member, unsubscriptable-object or
    not-an-iterable on self there.

    Refs #​3476
    Closes pylint-dev/pylint#7891

  • The ctypes brain now gives the value argument of c_int, c_char,
    c_double and the other simple types the same default as at runtime
    (0, 0.0, b"\x00", "\x00" or False). apple = c_int() no
    longer makes pylint emit no-value-for-parameter on interpreters where
    _ctypes is a built-in module, such as the uv and python-build-standalone
    builds.

    Refs #​3482

  • Fix a false positive for functools.partial objects stored as class attributes: before Python 3.14, accessing one through an instance does not bind self, and astroid no longer infers a bound method for it.

    Refs #​3491
    Closes pylint-dev/pylint#2271

Other Changes

  • A RecursionError raised while parsing a file is now enriched with a note
    naming the file that could not be parsed, and advising to raise the recursion
    limit (from pylint: --init-hook='import sys; sys.setrecursionlimit(2000)').

    Closes #​2974

Internal Changes

  • Remove register_builtin_transform from astroid.brain.brain_builtin_inference.
    It was only meant for astroid's own builtin brain, which now declares its inference
    functions in a static dispatch table.

    Refs #​1115

  • The changelog is now assembled by towncrier from news fragments in
    doc/whatsnew/fragments/, like in pylint. Add a <issue>.<type> fragment
    there instead of editing a changelog file.

    Closes #​3209

Performance Improvements

  • Collapse the 19 builtin inference transforms into a single dispatcher
    transform on nodes.Call. The transform visitor previously ran 19
    predicates per Call node, each repeating the same isinstance checks;
    the dispatcher does them once and routes by name via a dict.

    Refs #​1115

v4.3.4

Compare Source

What's new in astroid 4.3.4?

Release date: 2026-10-08

Bug Fixes

  • Fix a RecursionError when building a module from a live object that holds a
    container containing itself.

    Closes #​2974
    Closes pylint-dev/pylint#10459

  • Arguments.default_value() no longer raises IndexError when a keyword-only
    argument repeats the name of *args or **kwargs, as in def f(x, *y, y).

    Closes #​3259

  • Fix an infinite loop when introspecting a live class that exposes itself, or a
    sibling class, as one of its own attributes.

    Closes #​3284

  • Fix a TypeError crash when inferring random.sample() on a sequence whose
    elements are inferred as Instance.

    Closes #​3310

  • Catch ValueError during comparison inference (such as invalid byte values in bytes membership checks) and return Uninferable instead of raising an uncaught exception.

    Closes #​3333

  • A function whose body is only ... is now inferred to return Uninferable
    instead of None, the same as a function whose body is only pass. This
    is the astroid part of the fix for a false positive not-callable in pylint
    when calling a ... property stub, such as the sqlalchemy.func helpers.

    Refs #​3347
    Refs pylint-dev/pylint#8138

v4.3.3

Compare Source

What's new in astroid 4.3.3?

Release date: 2026-09-30

Bug Fixes

  • Preserve the length of inferred list and tuple concatenations when an element
    has multiple possible values. An ambiguous or uninferable element is now
    represented as unknown instead of being expanded into multiple sequence items.

    Refs #​3221
    Closes pylint-dev/pylint#2621

  • Fix TypeError in ClassDef.getitem when __class_getitem__ is uninferable.

    Closes #​3312

  • Fix AssertionError in NodeNG.root() when inferring Class.__bases__, which previously returned a parentless Tuple.

    Closes pylint-dev/pylint#11491

v4.3.2

Compare Source

What's new in astroid 4.3.2?

Release date: 2026-09-25

Bug Fixes

  • Fix a crash when a namedtuple or Enum type name or field name
    contains str.format markup, as in namedtuple("{0}", "abc"). The name
    is interpolated into an error message that astroid then reformats, so
    building the message raised IndexError. Inference now falls back to its
    default.

    Closes #​3199

  • Infer a functional TypeVar or NewType whose name is not an identifier
    without splicing that name into the synthesized class source. A crafted value
    such as TypeVar("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 InferenceError instead of crashing with IndexError when a class
    uses six.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's TypeVar node was mistaken for the class's actual
    __slots__ value; slots() now returns None for such classes
    instead of raising AttributeError.

    Refs #​3258

  • Fix a crash when inferring an f-string or str.format() call whose c format
    spec gets an out-of-range code point, such as f"{-1:c}". These now infer to
    Uninferable, like the %c case fixed in #​3254.

    Closes #​3301

  • The args attribute of an exception instance is now inferred as a tuple
    instance of unknown contents instead of a known empty tuple, so unpacking
    exc.args no longer looks unbalanced.

    Closes pylint-dev/pylint#11312

v4.3.1

Compare Source

What's New in astroid 4.3.1?

Release date: 2026-08-17

  • Fix inference of the attributes of a namedtuple created with
    rename=True. The renamed fields were applied to _fields and to the
    class body, but the instance kept the field names as written, so an instance
    of namedtuple("Tuple", "abc def", rename=True) was inferred as having a
    def attribute instead of _1, and duplicate field names collapsed into
    a single attribute instead of being renamed.

    Closes #​242

v4.3.0

Compare Source

What's New in astroid 4.3.0?

Release date: 2026-08-07

Version 4.2.0 was skipped: a v4.2.0 tag was created by mistake during an
aborted release attempt, so the changes from the 4.2.0 betas are released
as 4.3.0.

  • Fix a crash on a functional namedtuple whose field name changes under NFKC
    normalization, such as namedtuple("mu", ["µ"]). Python normalizes
    identifiers, so the parsed class stores the field under "μ" while the
    brain looked it up as written, raising KeyError on a definition that
    namedtuple itself accepts.

    Closes pylint-dev/pylint#8746

  • Fix inference of a method's first argument (self or cls) when the
    method's return value is stored on an unrelated object. This avoids inferring
    cls as the caller's class when indexing a tuple returned by a
    classmethod such as A.c()[0].

    Closes pylint-dev/pylint#11101

  • super() with no argument now resolves against the class of the object the
    method was called on, instead of the class the method is written in. One consequence
    is that a typing.Self return value survives a chain of super() calls.

    Closes #​2852
    Closes pylint-dev/pylint#10807

  • typing.overload stubs no longer shadow the implementation when a special
    method is looked up in the MRO.

    Closes #​2448

  • Fix a crash when the field names of a functional Enum or namedtuple
    call are bytes, as in Enum("", b""). Such a definition is invalid, so
    inference now falls back to its default instead of raising TypeError.

    Closes #​3189

  • Fix a crash when the body of a typing.NamedTuple subclass contains an
    assignment whose target is not a single name, such as cat.color = "black",
    basket[0] = "apple" or apple, banana = "red", "yellow". The names bound
    by unpacking are now copied to the inferred class as well.

    Closes #​3190

  • Fix a crash when a binary operation involves a class whose metaclass is not a
    class, as in class C(metaclass=sum) followed by C | None. The type of
    such a class is a function, which has no bases, so has_known_bases() now
    returns False for anything that is not a class.

    Closes #​3191

  • Fix a crash when a dataclass inherits from a dataclass that annotates
    __init__ as a field, as in __init__: int. Such a base binds
    __init__ to a name instead of a function, so it no longer contributes
    arguments to the generated __init__.

    Closes #​3200

  • The documentation build now fails on any Sphinx warning, so a cross-reference
    that does not resolve is caught by CI instead of quietly rendering as plain
    text. Uninferable, Position and the BadOperationMessage classes
    are documented as part of the public API, and a number of docstrings that
    Sphinx could not parse were repaired.

  • The >>> examples in the documentation are run when the documentation is
    built, so one that stops being true is noticed. Most of them could not run
    before: they printed node addresses recorded in 2018, and the multi-line ones
    were missing the ... continuation prompt. The example for Decorators
    reported the wrong line numbers.

  • Fix the example in the docstring of BoolOp, which showed the node it was
    copied from: astroid.extract_node("a and b") gives a BoolOp, not a
    BinOp.

  • Names written between single backticks in the ChangeLog render as code again,
    rather than as italics.

  • Prevent crashes while processing extension-module classes whose bases cannot
    be resolved when applying enum inference transformations.

    Closes pylint-dev/pylint#11179

  • The API documentation now covers the proxies, the objects with no node of
    their own, the inference context, the manager, the object models and the
    extension call signatures. The EvaluatedObject, Interpolation,
    NamedExpr and TemplateStr nodes were missing from the list of nodes
    and are listed now.

  • Add __required_keys__ and __optional_keys__ to the inferred
    TypedDict base class, so subclasses no longer raise a no-member
    false positive in pylint when accessing those attributes at runtime.

    Closes pylint-dev/pylint#10158

  • Comprehension conditions now constrain the inference of names used in the
    comprehension, like if statement conditions already did:
    [x for x in lst if x is not None] no longer infers None for x
    in the element expression.

    Refs #​3094

  • Fix isinstance() constraints only filtering the first inferred value of
    a variable: checking a value made the isinstance classinfo uninferable
    for the checks of the following values.

  • Remove Python 2 era dead code and outdated comments.
    Notably: the internal TreeRebuilder constructor no longer takes a
    parser_module argument.

    Refs #​3154

  • Fix inference of a starred target that is not last in a for loop, such as
    for a, *b, c in .... The elements following the starred one were counted
    from the target's own arity rather than from the end of the iterable, so
    b was truncated whenever the iterable was longer than the target.

  • Add qname() method to the Slice node class, returning
    "builtins.slice", so that the node can be used in contexts
    that require a qualified name (e.g. pylint's basic_checker).

    Closes #​3115

  • Add brain tip for numpy.fromfile so that calls to
    np.fromfile(...) are correctly inferred as returning
    numpy.ndarray instead of Uninferable.

    Closes #​600

  • Add brain for decimal that gets applied if _decimal isn't available.

  • Removed the **kwargs argument from all infer functions.
    Users upgrading their astroid versions should ensure they do no pass values other than
    context to infer.

  • Deduplicate keys when inferring dict.fromkeys. dict.fromkeys("aab")
    now infers a dict with keys "a", "b" instead of "a", "a",
    "b", matching the runtime. This also stops dict.fromkeys from
    materializing one Const node per character for a repeated string such as
    dict.fromkeys("x" * 10 ** 8), which is a single-key dict.

  • Bound str/bytes and list/tuple concatenation (a + b) during inference.

  • Bound oversized old-style (%) string/bytes formatting during inference.
    A tiny literal such as "%1000000000d" % 1 made
    _infer_old_style_string_formatting eagerly build a multi-gigabyte
    Const while inferring otherwise untrusted source. The width and
    precision are now read out of the conversion specifiers (including *
    fields) and the interpolation infers as Uninferable past 1e8,
    mirroring the repetition, concatenation and str.format caps. Bytes
    % formatting is routed through the same handler so it is bounded too;
    small format strings keep inferring their exact value.

  • Fix crash (TypeError: 'UninferableBase' object is not iterable) in the
    multiprocessing brain when a local package shadows the stdlib
    multiprocessing module.

    Closes pylint-dev/pylint#10014

  • Bound the number of nodes built when inferring list/set/tuple/
    frozenset and dict.fromkeys from a str/bytes constant. These
    built one Const node per character with no cap, so ``list(("a" * 10 ** 8)

    • "b")(concatenation is not size-bounded) materialized hundreds of millions of nodes. They now fall back to the default inference past1e8`` characters,
      matching the sequence-repetition guard.

Refs #​3127

  • Bound string/bytes multiplication ("x" * n) and integer left shifts
    (1 << n) in const_infer_binary_op the same way list/tuple
    multiplication and ** already are. Inferring a constant such as
    "A" * 10 ** 10 previously materialized the multi-gigabyte result
    eagerly; these operations now infer as Uninferable when the result
    would be oversized.

    Refs #​3107

  • Bound the field width and precision when inferring str.format calls.
    A template such as "{:>2000000000}".format("x") (or a width/precision
    supplied through a nested {} field) previously built the padded
    multi-gigabyte string eagerly during inference; such calls now infer as
    Uninferable when the field size would be oversized.

    Refs #​3131

  • Remove the asname keyword argument from Import._infer and
    ImportFrom._infer. The alias-to-real-name translation that
    asname=True performed is now hoisted into ImportNode._infer_name,
    which runs in _infer_stmts before _infer is dispatched. Direct
    callers of Import.infer / ImportFrom.infer (previously the
    asname=False path) now consistently resolve the lookup name as-is.

    The two flows used to collapse into a single inference cache entry
    because the asname kwarg was not part of the cache key, so the
    second call returned the cached result of the first regardless of
    which one ran. With the translation hoisted upstream, the two flows
    set different lookupname values and therefore land on distinct
    cache keys, eliminating the collision.

    Refs pylint-dev/pylint#10193
    Closes #​3007

  • Avoid materializing a multi-gigabyte string while inferring a small literal
    such as "{:>2000000000}".format("x") or f"{1.5:.2000000000f}".
    _infer_str_format_call and FormattedValue._infer now yield
    Uninferable when a format spec asks for a width or precision over 1e8,
    mirroring the sequence/repetition caps in astroid.protocols.

Refs #​3108

  • Fix uncaught IndentationError when parsing code whose lines end in
    \r: the slice of source tokenized to compute a class or function
    position is split on \n only and could be misaligned with the AST
    line numbers. Such nodes now simply have no position information, as
    already done when tokenize raises TokenError.

    Closes #​3091

  • Support PEP 810 lazy imports (new in Python 3.15). Import and
    ImportFrom nodes gain an is_lazy integer attribute, mirroring
    the ast field of the same name.

  • Support PEP 798 comprehension unpacking ({**d for d in dicts},
    new in Python 3.15).

  • Fix astroid bootstrap crash on PyPy 7.3.22 (TypeError: expected str, got getset_descriptor object) by also catching TypeError from
    getattr(obj, alias) in InspectBuilder.object_build. PyPy 7.3.22
    raises TypeError instead of AttributeError for unset getset
    descriptors like types.FunctionType.__text_signature__, which made
    _astroid_bootstrapping() blow up on any call into astroid.

    Refs pylint-dev/pylint#10999

  • Shorten import astroid by deferring imports only needed on cold paths.
    logging (used by modutils and raw_building solely to report
    stderr/stdout captured while importing a module) and pprint (used only
    to format debug __repr__ / repr_tree output) are now imported
    lazily, and astroid.exceptions imports astroid.typing under
    TYPE_CHECKING.

  • Fix AttributeError crash in starred_assigned_stmts when a starred
    unpacking target is an attribute (e.g. for *o.attr, x in ...) rather
    than a simple name.

    Closes #​2646

  • Fix AttributeError crash in the Arguments assigned_stmts
    protocol when called without an inference context (the public
    assigned_stmts API defaults context to None). Resolving a
    function's first parameter dereferenced context.boundnode while the
    matching context and ... guard a few lines below was missing; it now
    degrades to Uninferable.

  • Fix AttributeError crash in ClassDef.infer_call_result when called
    through the public API without a context (it defaults to None) for a
    class whose metaclass defines __call__: the callee was assigned to
    context.callcontext.callee without checking that a call context exists.
    It is now guarded, matching the surrounding code.

  • Wrap assignment expressions (:=) in parentheses when emitting
    as_string output so the rendered code remains syntactically valid in
    contexts such as comparisons, where Python requires the walrus expression
    to be parenthesized.

    Closes #​2668

  • Catch MemoryError/RecursionError (and ValueError) when validating
    type comments with ast.parse. Pathological type comments produced by
    fuzzers (e.g. # type: i{{{{{{{...) previously crashed parsing with a
    MemoryError or RecursionError depending on the runtime; astroid now
    treats them as invalid type comments and skips them, mirroring the f-string
    fix from #​2762.

    Closes #​2993

  • Bypass __init__ in InferenceContext.clone() and write the slots
    directly. clone() is called ~85k times per pandas/frame.py pylint run;
    skipping the conditional defaults shaves measurable time off the hottest
    constructor in inference.

    Refs #​1115

  • Fix TypeError in brain_random when random.sample is called with a
    sequence containing nodes whose __init__ does not accept lineno
    (e.g. Module). The clone helper now filters init params to those the
    class actually accepts.

    Closes #​3043

  • Fix RecursionError in _compute_mro() when circular class hierarchies
    are created through runtime name rebinding. Circular bases are now resolved
    to the original class instead of recursing.

    Closes #​3023
    Closes pylint-dev/pylint#10821

  • Changed block_range to consider else its own block, allowing pylint to apply
    disables to just the block.

    References pylint-dev/pylint#872

  • Fix uncaught TokenError when building a class or function whose source
    slice is malformed. tokenize.generate_tokens may raise (e.g. on an
    unterminated bracket on Python < 3.12); position computation now treats such
    a node as having no position information instead of crashing.

    Closes #​2527

  • str() of a constant argument now infers the actual string value instead
    of always inferring "". When every inference path of the argument
    resolves to Const values that stringify to the same string, infer_str
    returns that string; otherwise it keeps falling back to Const("").

    Closes #​2994

  • Fix AttributeError crash when looking up a special method on a class
    whose explicit metaclass infers to a non-class node (e.g. a function). Such
    a metaclass has no MRO, so the dunder lookup now raises
    AttributeInferenceError instead of crashing.

    Closes #​3063

  • Fix AttributeError crash in ClassDef.getitem when __class_getitem__
    resolves to a non-callable node (e.g. an AssignName). getitem now
    raises AstroidTypeError in that case, consistent with its documented
    behaviour.

    Closes #​3064

  • Fix DuplicateBasesError crash in the enum brain when inferring an enum
    class with duplicate bases (e.g. class C(enum.Enum, enum.Enum)).
    infer_enum_class now catches MroError and leaves such a malformed
    class untransformed.

    Closes #​3065

  • Fix InferenceError crash in ClassDef.slots() when __slots__ is
    declared as an annotation without a value (e.g. __slots__: None). Such

[!IMPORTANT]
✂ PR body was truncated to here.


Configuration

📅 Schedule: (in timezone Europe/Paris)

  • Branch creation
    • At 12:00 AM through 04:59 AM and 10:00 PM through 11:59 PM, Monday through Friday (* 0-4,22-23 * * 1-5)
    • Only on Sunday and Saturday (* * * * 0,6)
  • Automerge
    • At any time (no schedule defined)

🚦 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.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

Copilot AI balanced review requested due to automatic review settings October 14, 2026 01:03
@renovate renovate Bot added dependencies Pull requests that update a dependency file. filigran team Item from the Filigran team. labels Oct 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The updated dependency exists and is compatible with the documentation build’s Python 3.12 environment.

0 open findings

What changed in this PR

Updates Astroid for Sphinx AutoAPI documentation generation.

Changes:

  • Bumps Astroid from 3.3.11 to 4.3.4.
File Description
docs/​requirements.txt Updates the pinned Astroid documentation dependency.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@renovate
renovate Bot force-pushed the renovate/astroid-4.x branch from f11947a to 4edf0be Compare October 26, 2026 23:12
@renovate
renovate Bot force-pushed the renovate/astroid-4.x branch from 4edf0be to afb7c1a Compare December 4, 2026 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file. filigran team Item from the Filigran team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant