Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type hinting a class decorator that returns a subclass #1528

Closed
BojieSheng opened this issue Dec 9, 2023 · 0 comments
Closed

Type hinting a class decorator that returns a subclass #1528

BojieSheng opened this issue Dec 9, 2023 · 0 comments
Labels
topic: other Other topics not covered

Comments

@BojieSheng
Copy link

BojieSheng commented Dec 9, 2023

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.

@BojieSheng BojieSheng added the topic: other Other topics not covered label Dec 9, 2023
@python python locked and limited conversation to collaborators Dec 9, 2023
@AlexWaygood AlexWaygood converted this issue into discussion #1529 Dec 9, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
topic: other Other topics not covered
Projects
None yet
Development

No branches or pull requests

1 participant