OpenQuizz
Une application de gestion des contenus pédagogiques
Tuple Class Reference
Inheritance diagram for Tuple:
Collaboration diagram for Tuple:

Public Member Functions

def __init__ (self, types)
 
def name (self)
 
def arity (self)
 
def convert (self, value, param, ctx)
 
- Public Member Functions inherited from ParamType
def __call__ (self, value, param=None, ctx=None)
 
def get_metavar (self, param)
 
def get_missing_message (self, param)
 
def split_envvar_value (self, rv)
 
def fail (self, message, param=None, ctx=None)
 

Data Fields

 types
 

Additional Inherited Members

- Static Public Attributes inherited from CompositeParamType
bool is_composite = True
 
- Static Public Attributes inherited from ParamType
bool is_composite = False
 
 name = None
 
 envvar_list_splitter = None
 

Detailed Description

The default behavior of Click is to apply a type on a value directly.
This works well in most cases, except for when `nargs` is set to a fixed
count and different types should be used for different items.  In this
case the :class:`Tuple` type can be used.  This type can only be used
if `nargs` is set to a fixed number.

For more information see :ref:`tuple-type`.

This can be selected by using a Python tuple literal as a type.

:param types: a list of types that should be used for the tuple items.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  types 
)

Member Function Documentation

◆ arity()

def arity (   self)

Reimplemented from CompositeParamType.

◆ convert()

def convert (   self,
  value,
  param,
  ctx 
)
Converts the value.  This is not invoked for values that are
`None` (the missing value).

Reimplemented from ParamType.

◆ name()

def name (   self)

Field Documentation

◆ types

types

The documentation for this class was generated from the following file: