Skip to content

Support GenericMeta #3366

Closed
Closed
@gvanrossum

Description

@gvanrossum

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions