MCPcopy Index your code
hub / github.com/PySimpleGUI/PySimpleGUI / mapping

Method mapping

DemoPrograms/Demo_Desktop_Widget_RAM_Gauge.py:32–45  ·  view source on GitHub ↗

Map function with extra argument, not for tuple. : Parameters func - function to call. sequence - list for iteration. argc - more arguments for func. : Return list of func(element of sequence, *argc)

(func, sequence, *argc)

Source from the content-addressed store, hash-verified

30
31class Gauge():
32 def mapping(func, sequence, *argc):
33 """
34 Map function with extra argument, not for tuple.
35 : Parameters
36 func - function to call.
37 sequence - list for iteration.
38 argc - more arguments for func.
39 : Return
40 list of func(element of sequence, *argc)
41 """
42 if isinstance(sequence, list):
43 return list(map(lambda i: func(i, *argc), sequence))
44 else:
45 return func(sequence, *argc)
46
47 def add(number1, number2):
48 """

Callers 6

__init__Method · 0.45
moveMethod · 0.45
__init__Method · 0.45
moveMethod · 0.45
__init__Method · 0.45
moveMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected