Skip to content

Support generic class (i.e. __class_getitem__) #2917

@moreal

Description

@moreal

Feature

CPython-side

>>> class Generic:
...   def __class_getitem__(cls, item, *args, **kwargs):
...     return (cls, item, args, kwargs)
... 
>>> Generic[int, str]
(<class '__main__.Generic'>, (<class 'int'>, <class 'str'>), (), {})

RustPython-side

>>>>> class Generic:
.....   def __class_getitem__(cls, item, *args, **kwargs):
.....     return (cls, item, args, kwargs)
..... 
>>>>> Generic[int, str]
<class 'type'>

Python Documentation

Metadata

Metadata

Assignees

No one assigned

    Labels

    z-ca-2021Tag to track contrubution-academy 2021

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions