Skip to content

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

Closed

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

Activity

  1. moreal commented on Aug 20, 2021

    @moreal
    ContributorAuthor

    I started to work this one.

  2. moreal commented on Aug 21, 2021

    @moreal
    ContributorAuthor

    I didn't know there is already to resolve this issue. I believe #2633 will resolve this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions