# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/04_pttype.ipynb.

# %% auto 0
__all__ = ['PTMeta', 'PTType']

# %% ../nbs/04_pttype.ipynb 4
from abc import ABCMeta

from typing import Any, Tuple

# %% ../nbs/04_pttype.ipynb 6
class PTMeta(ABCMeta):
    """
    Base metaclass for PyTorch typing classes. It handles parameterization and string representation.
    """

    __args__: Tuple[Any]
    _parameterized: bool

    def __getitem__(cls, item):
        cls.__args__ = (item,)
        return cls

    def __str__(cls):
        return f"{cls.__name__}[{cls.__args__[0]}]"
    
    def __subclasscheck__(cls, subclass):
        return subclass is cls

# %% ../nbs/04_pttype.ipynb 7
class PTType(metaclass=PTMeta):
    """
    Base class for PyTorch typing classes.
    """

    __args__ = (Any,)
