Skip to content

TypeError: descriptor '__subclasses__' of 'type' object needs an argument #266

@gvanrossum

Description

@gvanrossum

Behold:

ExcInfo = Tuple[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]]

produces a traceback:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "typing.py", line 656, in __getitem__
    return Union[arg, type(None)]
  File "typing.py", line 556, in __getitem__
    dict(self.__dict__), parameters)
  File "typing.py", line 516, in __new__
    for t2 in all_params - {t1} if not isinstance(t2, TypeVar)):
  File "typing.py", line 516, in <genexpr>
    for t2 in all_params - {t1} if not isinstance(t2, TypeVar)):
  File "typing.py", line 1090, in __subclasscheck__
    if super(GenericMeta, self).__subclasscheck__(cls):
  File "/Users/guido/v/lib/python2.7/abc.py", line 179, in __subclasscheck__
    for scls in cls.__subclasses__():
TypeError: descriptor '__subclasses__' of 'type' object needs an argument

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions