class_docstr: Metaclass to support subtyping with parameters for pattern matching, e.g. ``Number[int, int]``.
class_docstr_tok: ["Metaclass","to","support","subtyping","with","parameters","for","pattern","matching",",","e.g",".","``","Number","[","int",",","int","]","``","."]
code: def __init__(cls, name, bases, dct):
      super().__init__(name, bases, dct)
      if not hasattr(cls, "__args__"):
          cls.__args__ = ()
      if cls.__args__:
          (base,) = bases
          cls.__origin__ = base
      else:
          cls._type_cache = weakref.WeakValueDictionary()
  
imports: import functools
  import sys
  import typing
  import weakref
  import typing_extensions
  from multipledispatch.variadic import Variadic
  from multipledispatch.variadic import isvariadic
label_desc: Use image node_id 1 to create a new GenericTypeMeta object from inherited base classes: type with example: obj = GenericTypeMeta(cls, name, bases, dct)