MCPcopy Create free account
hub / github.com/EntilZha/PyFunctional / __call__

Method __call__

functional/streams.py:29–46  ·  view source on GitHub ↗

Create a Sequence using a sequential ExecutionEngine. If args has more than one argument then the argument list becomes the sequence. If args[0] is primitive, a sequence wrapping it is created. If args[0] is a list, tuple, iterable, or Sequence it is wrapped as a

(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

27 self.max_repr_items = max_repr_items
28
29 def __call__(self, *args, **kwargs):
30 """
31 Create a Sequence using a sequential ExecutionEngine.
32
33 If args has more than one argument then the argument list becomes the sequence.
34
35 If args[0] is primitive, a sequence wrapping it is created.
36
37 If args[0] is a list, tuple, iterable, or Sequence it is wrapped as a Sequence.
38
39 :param args: Sequence to wrap
40 :return: Wrapped sequence
41 """
42 # pylint: disable=no-self-use
43 engine = ExecutionEngine()
44 return self._parse_args(
45 args, engine, "seq() takes at least 1 argument ({0} given)"
46 )
47
48 def _parse_args(self, args, engine, error_message):
49 if len(args) == 0:

Callers

nothing calls this directly

Calls 2

_parse_argsMethod · 0.95
ExecutionEngineClass · 0.90

Tested by

no test coverage detected