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 @@
Parameters
@@ -212,11 +212,207 @@
Return type
-

Tuple[str, float, str]

+

Tuple[int, float, str]

+
+
+square(elems)[source]
+

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]
+
+
+
+
Return type
+

List[float]

+
+
Parameters
+

elems (Sequence[float]) –

+
+
+
+ +
+
+create_deck_without_alias(shuffle=False)[source]
+

Create a new deck of 52 cards

+
+
Return type
+

List[Tuple[str, str]]

+
+
Parameters
+

shuffle (bool) –

+
+
+
+ +
+
+create_deck_with_alias(shuffle=False)[source]
+

Create a new deck of 52 cards

+

Card = Tuple[str, str]

+

Deck = List[Card]

+

Return Deck

+
+
Return type
+

List[Tuple[str, str]]

+
+
Parameters
+

shuffle (bool) –

+
+
+
+ +
+
+choose_from_list_of_Any_returns_a_Any(items)[source]
+

Option1 (BAD) : avoid using ‘Any’ because too general

+
+
Return type
+

Any

+
+
Parameters
+

items (Sequence[Any]) –

+
+
+
+ +
+
+choose_from_list_of_a_specific_type_returns_same_type(items)[source]
+

Option2 (BETTER) : prefer ‘TypeVar’ instead of ‘Any’

+

T = TypeVar(“T”)

+
+
Return type
+

~T

+
+
Parameters
+

items (Sequence[my_package1.my_module1.T]) –

+
+
+
+ +
+
+choose_from_list_of_a_specific_constrained_type_returns_same_type(items)[source]
+

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:

+ +

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)

+
+
Return type
+

~T

+
+
Parameters
+

items (Sequence[my_package1.my_module1.T]) –

+
+
+
+ +
+
+create_greeting(congrat, name, nb)[source]
+
+
Return type
+

str

+
+
Parameters
+
    +
  • congrat (str) –

  • +
  • name (str) –

  • +
  • nb (int) –

  • +
+
+
+
+ +
+
+do_twice(func, arg1, arg2, arg3)[source]
+

Usage:

+
>>> do_twice(create_greeting, "Hello", "Jekyll", 1)
+Hello Jekyll 1
+Hello Jekyll 1
+
+
+
+
Return type
+

None

+
+
Parameters
+
    +
  • func (Callable[[str, str, int], str]) –

  • +
  • arg1 (str) –

  • +
  • arg2 (str) –

  • +
  • arg3 (int) –

  • +
+
+
+
+ +
+
+exception DCCNotFoundException[source]
+

Bases: Exception

+

Raised when a specific DCC is not available

+
+ +
+
+exception UnknownGenericCmdArgException(name, arg)[source]
+

Bases: Exception

+

Raised when a GENERIC cmd argument is not recognized by the controller (no native cmd available for the generic cmd)

+
+
Parameters
+
    +
  • name (str) –

  • +
  • arg (str) –

  • +
+
+
+
+
+__str__()[source]
+

Return str(self).

+
+ +
+ +
+
+exception UnknownNativeCmdException(*args, **kwargs)[source]
+

Bases: Exception

+

Raised when a NATIVE command name is not recognized by the controller

+
+ +
+
+exception UnimplementedGenericCmdException[source]
+

Bases: Exception

+

Raised when a GENERIC cmd has no implementation in the controller (no native cmd available for the generic cmd)

+
+
+__str__()[source]
+

Return str(self).

+
+ +
+
class MySuperClass1[source]
@@ -362,7 +558,8 @@
classmethod fromBirthYear(name, year)[source]
-
+

NB : return type ‘Person’ is possible because of: ‘from __future__ import annotations’

+
Return type

Person

-- libgit2 0.21.2