Skip to content

Type hinting a class decorator that returns a subclass #1528

Closed

Description

@BojieSheng

Anyone knows who to annotate "cls" and return type for below function "examle_a"?

def example_a(cls):
    class A(cls):
        def __init__(self, x, y):
            self.x=x
            self.y=y
            super().__init__(x,y)

    return A

cls can be any class.

Activity

  1. locked and limited conversation to collaborators on Dec 9, 2023
  2. converted this issue into a discussion #1529 on Dec 9, 2023
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

    topic: otherOther topics not covered

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions