Skip to content

False positive E1136 unsubscriptable-object on ExceptionGroup #10558

@sprat

Description

@sprat

Bug description

Here is some code triggering the issue:

"""Main module"""

def main() -> None:
    """Main program"""
    exc_group = ExceptionGroup('message', [RuntimeError('oops')])
    print(type(exc_group.exceptions))  # <class 'tuple'>
    exc = exc_group.exceptions[0]  # E1136 is triggered here
    print(exc)  # oops


if __name__ == '__main__':
    main()

Configuration

Command used

pylint .

Pylint output

************* Module unsubscriptable
unsubscriptable.py:7:10: E1136: Value 'exc_group.exceptions' is unsubscriptable (unsubscriptable-object)

Expected behavior

Since exc_group.exceptions is a tuple, I should not get this warning.

Pylint version

pylint 3.3.8
astroid 3.3.11
Python 3.11.2 (main, Apr 28 2025, 14:11:48) [GCC 12.2.0]

OS / Environment

Debian bookworm

Additional dependencies

Metadata

Metadata

Assignees

No one assigned

    Labels

    False Positive 🦟A message is emitted but nothing is wrong with the code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions