Skip to content

[Python 3.9 compat] type is now subscriptable. #3950

@JulienPalard

Description

@JulienPalard

Since Python 3.9, type is made subscriptable by Objects/abstract.c (python/cpython@48b069a), to allow, for example, type[int].

print(type[int])

which give:

test.py:10:6: E1136: Value 'type' is unsubscriptable (unsubscriptable-object)

while the code works.

Related to #3890.
See also #3882.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions