Skip to content
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

Support GenericMeta #3366

Closed
gvanrossum opened this issue May 15, 2017 · 2 comments
Closed

Support GenericMeta #3366

gvanrossum opened this issue May 15, 2017 · 2 comments

Comments

@gvanrossum
Copy link
Member

This forked off #1764. Example:

from typing import *
from typing import GenericMeta  # needed for python3 runtime
import six

class _DestroyableMeta(type): pass

class Destroyable(six.with_metaclass(_DestroyableMeta)):
    pass

T_co = TypeVar('T_co', bound='Destroyable', covariant=True)

class ArcMeta(GenericMeta, _DestroyableMeta):
    pass

class Arc(six.with_metaclass(ArcMeta, Generic[T_co], Destroyable)):
    pass

Even with #3364 this still gives an error on the occurrence of Generic in the base classes:

u.py:16: error: Invalid type "typing.Generic"
u.py:16: error: Invalid base class
@ilevkivskyi
Copy link
Member

Should anything be done here after #3364 is merged?
(It looks like we already have #3365 to track possible metaclass conflicts.)

@gvanrossum
Copy link
Member Author

Yeah, this example now works.

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

No branches or pull requests

2 participants