github pylint-dev/astroid v4.1.0

13 hours ago

What's New in astroid 4.1.0?

Release date: 2026-02-08

  • Add support for equality constraints (==, !=) in inference.
    Closes pylint-dev/pylint#3632
    Closes pylint-dev/pylint#3633

  • Ensure ast.JoinedStr nodes are Uninferable when the ast.FormattedValue is
    Uninferable. This prevents unexpected-keyword-arg messages in Pylint
    where the Uninferable string appeared in function arguments that were
    constructed dynamically.

    Closes pylint-dev/pylint#10822

  • Add support for type constraints (isinstance(x, y)) in inference.

    Closes pylint-dev/pylint#1162
    Closes pylint-dev/pylint#4635
    Closes pylint-dev/pylint#10469

  • Make type.__new__() raise clear errors instead of returning None

  • Move object dunder methods from FunctionModel to ObjectModel to make them
    available on all object types, not just functions.

    Closes #2742
    Closes #2741
    Closes pylint-dev/pylint#6094

  • lineno and end_lineno are now available on Arguments.

  • Add helper to iterate over all annotations nodes of function arguments,
    Arguments.get_annotations().

    Refs #2860

  • Skip direct parent when determining the Decorator frame.

    Refs pylint-dev/pylint#8425

  • Add simple command line interface for astroid to output generated AST.
    Use with python -m astroid.

  • Fix incorrect type inference for super().method() calls that return Self.
    Previously, astroid would infer the parent class type instead of the child class type,
    causing pylint E1101 false positives in method chaining scenarios.

    Closes #457

  • Add missing dtype and casting parameters to numpy.concatenate brain.

    Closes #2870

  • Fix ability to detect .py modules inside PATH directories on Windows
    described by a UNC path with a trailing backslash (\)

    • Example: modutils.modpath_from_file(filename=r"\Mac\Code\tests\test_resources.py", path=["\mac\code"]) == ['tests', 'test_resources']
  • Fix random.sample inference crash when sequence contains uninferable elements.

    Closes #2518

  • Fix random.sample crash when cloning ClassDef or FunctionDef nodes.

    Closes #2923

Don't miss a new astroid release

NewReleases is sending notifications on new releases.