class_docstr: Type variable.
class_docstr_tok: ["Type","variable","."]
code: def __new__(
      cls,
      name,
      *constraints,
      bound=None,
      covariant=False,
      contravariant=False,
      default=_marker,
      infer_variance=False,
  ):
      if hasattr(typing, "TypeAliasType"):
          # PEP 695 implemented (3.12+), can pass infer_variance to typing.TypeVar
          typevar = typing.TypeVar(
              name,
              *constraints,
              bound=bound,
              covariant=covariant,
              contravariant=contravariant,
              infer_variance=infer_variance,
          )
      else:
          typevar = typing.TypeVar(
              name,
              *constraints,
              bound=bound,
              covariant=covariant,
              contravariant=contravariant,
          )
          if infer_variance and (covariant or contravariant):
              raise ValueError(
                  "Variance cannot be specified with infer_variance."
              )
          typevar.__infer_variance__ = infer_variance
      _set_default(typevar, default)
      _set_module(typevar)
      return typevar
  
imports: import abc
  import collections
  import collections.abc
  import functools
  import inspect
  import operator
  import sys
  import types
  import typing
  import warnings
label_desc: Use image node_id 1 for calling the TypeVar obj's underlying member method code with example usage: obj.__new__(cls, name) and returns: typevar