Skip to content

Callable and Tuple should be subclassable. #299

Closed
@ilevkivskyi

Description

@ilevkivskyi

One can subclass collections.abc.Mapping as well as typing.Mapping[str, int]. However, it is currently prohibited to subclass typing.Callable and typing.Tuple:

class C(collections.abc.Callable): ...  # works
class C(typing.Callable): ...           # fails

class C(typing.List[T]): ...            # works
class C(typing.Tuple[T, ...]): ...      # fails

I think that both Callable and Tuple should be subclassable (at least in the simple form shown above).

@gvanrossum If you agree, then you can assign this issue to me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions