diff --git a/doc/code_style/my_package1/html/my_package1.my_module1.html b/doc/code_style/my_package1/html/my_package1.my_module1.html index 7ff31a3..b4be96c 100644 --- a/doc/code_style/my_package1/html/my_package1.my_module1.html +++ b/doc/code_style/my_package1/html/my_package1.my_module1.html @@ -178,7 +178,7 @@
arg_a (int
) – the path of the file to wrap
arg_b (str
) – instance to wrap
arg_b (Union
[str
, int
, float
]) – instance to wrap (in Python 3.10 we will be able to use ‘str | int | float’ instead)
arg_c (float
) – toto
arg_d (bool
) – whether or not to delete the file when the File instance is destructed
Tuple
[str
, float
, str
]
Tuple
[int
, float
, str
]
function that takes a Sequence (either List of Tuple) as input, and send a List as output
+Usage:
+>>> square( [1,2,3] )
+[1, 4, 9]
+>>> square( (1,2,3) )
+[1, 4, 9]
+
List
[float
]
elems (Sequence[float]) –
+Create a new deck of 52 cards
+List
[Tuple
[str
, str
]]
shuffle (bool) –
+Create a new deck of 52 cards
+Card = Tuple[str, str]
+Deck = List[Card]
+Return Deck
+List
[Tuple
[str
, str
]]
shuffle (bool) –
+Option1 (BAD) : avoid using ‘Any’ because too general
+Any
items (Sequence[Any]) –
+Option2 (BETTER) : prefer ‘TypeVar’ instead of ‘Any’
+T = TypeVar(“T”)
+~T
+items (Sequence[my_package1.my_module1.T]) –
+Option3 (still BETTER) : use a ‘constrained TypeVar’
+T = TypeVar(“T”, str, float)
+(you could name ‘T’ as you want, for example, ‘Choosable’…)
+=> the function accepts only sequence of str or float:
+if str: return str
if float: return float
Usage:
+choose([“Guido”, “Jukka”, “Ivan”]) => str, OK
+choose([1, 2, 3]) => float, OK (car int subtype of float)
+choose([True, 42, 3.14]) => float, OK (car bool subtype of int which is subtype of float)
+choose([“Python”, 3, 7]) => object, KO (rejected)
+~T
+items (Sequence[my_package1.my_module1.T]) –
+str
congrat (str) –
name (str) –
nb (int) –
Usage:
+>>> do_twice(create_greeting, "Hello", "Jekyll", 1)
+Hello Jekyll 1
+Hello Jekyll 1
+
None
func (Callable[[str, str, int], str]) –
arg1 (str) –
arg2 (str) –
arg3 (int) –
Bases: Exception
Raised when a specific DCC is not available
+Bases: Exception
Raised when a GENERIC cmd argument is not recognized by the controller (no native cmd available for the generic cmd)
+name (str) –
arg (str) –
Return str(self).
+Bases: Exception
Raised when a NATIVE command name is not recognized by the controller
+Bases: Exception
Raised when a GENERIC cmd has no implementation in the controller (no native cmd available for the generic cmd)
+Return str(self).
+NB : return type ‘Person’ is possible because of: ‘from __future__ import annotations’
+