Exemplo n.º 1
0
 def __init__(self, name: str = None, _path: t.Union[str, t.Iterable, None] = None):
     """
     :param name: (optional) A name for the Var instance. Variables
      in a formula may be equated using their names.
     :param _path: (optional) A technical argument, used for passing
      path tuple between Var constructors.
     """
     self._name = name
     if _path is None:
         self._path = ()
     elif is_iterable(_path):
         self._path = tuple(_path)
     elif isinstance(_path, str):
         self._path = tuple(_path.split('.'))
 def __init__(self, name: str = None, _path: t.Union[str, t.Iterable, None] = None):
     """
     :param name: (optional) A name for the Var instance. Variables
      in a formula may be equated using their names.
     :param _path: (optional) A technical argument, used for passing
      path tuple between Var constructors.
     """
     self._name = name
     if _path is None:
         self._path = ()
     elif is_iterable(_path):
         self._path = tuple(_path)
     elif isinstance(_path, str):
         self._path = tuple(_path.split('.'))
 def __init__(self, name=None, _path=None):
     # type: (str, Union[str, Iterable, None]) -> None
     """
     :param name: (optional) A name for the Var instance. Variables
      in a formula may be equated using their names.
     :param _path: (optional) A technical argument, used for passing
      path tuple between Var constructors.
     """
     self._name = name
     self._path = None  # type: Tuple[Optional[str]]
     if _path is None:
         self._path = ()  # type: ignore noqa
     elif is_iterable(_path):
         self._path = tuple(_path)  # type: ignore noqa
     else:
         self._path = (_path, )  # type: ignore noqa
Exemplo n.º 4
0
 def _cmp(value):
     return is_iterable(value) and all(e in value for e in cond)
Exemplo n.º 5
0
 def _cmp(value):
     return is_iterable(value) and all(cond(e) for e in value)
Exemplo n.º 6
0
 def _cmp(value):
     return is_iterable(value) and any(e in cond for e in value)
Exemplo n.º 7
0
 def _cmp(value):
     return is_iterable(value) and all(e in value for e in cond)
Exemplo n.º 8
0
 def _cmp(value):
     return is_iterable(value) and all(cond(e) for e in value)
Exemplo n.º 9
0
 def _cmp(value):
     return is_iterable(value) and any(e in cond for e in value)