my_package1.my_module1 module¶
+-
+
- +general_function_that_returns_a_float(arg_a, arg_b, arg_c=1.2, arg_d=True)[source]¶ +
This function is used for … blabla …
+-
+
- Parameters +
-
+
arg_a (
int
) – the path of the file to wrap
+arg_b (
str
) – instance to wrap
+arg_c (
float
) – toto
+arg_d (
bool
) – whether or not to delete the file when the File instance is destructed
+
+- Return type +
+float
+- Returns +
A buffered writable file descriptor
+
+- Raises +
-
+
AttributeError – The
Raises
section is a list of all exceptions + that are relevant to the interface.
+ValueError – If arg_a is equal to arg_b.
+
+
-
+
- +general_function_that_returns_a_tuple_of_3_elem(a, b=2, c='titi')[source]¶ +
Commentaire général sur la fonction
+-
+
- Parameters +
-
+
a (
int
) – the path of the file to wrap
+b (
int
) – instance to wrap
+c (
str
) – toto
+
+- Return type +
+Tuple
[str
,float
,str
]
+
-
+
- +class MySimpleClass(a, b)[source]¶ +
Bases:
+my_package1.my_module1.MySuperClass1
,my_package1.my_module1.MySuperClass2
a Class with multi-inheritance
+blabla
+blabla
+La methode __init__ doit toujours retourner “None”
+-
+
- Parameters +
-
+
a (
int
) – blabla
+b (float) –
+
+- Return type +
None
+
+
-
+
- +names: List[str] = ['Guido', 'Jukka', 'Ivan']¶ +
List is mutable
+
-
+
- +version: Tuple[int, int, int] = (3, 7, 1)¶ +
Tuple is UNmutable
+
-
+
- +options: Dict[str, bool] = {'capitalize': True, 'centered': False}¶ +
Dict (is mutable)
+
-
+
- +my_attr1: dict = {}¶ +
-
+
- +current_file = None¶ +
-
+
- +pickle_file = 'obsconfig.p'¶ +
-
+
- +class Person(name, age)[source]¶ +
Bases:
+object
Class to create a person, in several ways (several Factory methods)
+=> Illustrate difference btw static and class methods
+Usage:
+-
+
Classic Constructor :
+
++>>> person1 = Person('Alfredo', 21) +
-
+
Class method (Factory) :
+
++>>> person2 = Person.fromBirthYear('Peter', 2000) +>>> person2.age +22 +
-
+
Another class method (Factory) :
+
++>>> person3 = Person.twin('John', person2) +>>> person3.age == person2.age +True +>>> person3.name == person2.name +False +
-
+
Static method (does not need access to the class attributes or methods) :
+
++>>> Person.isAdult(22) +True +
-
+
- Parameters +
-
+
name (str) –
+age (int) –
+
+- Return type +
None
+
+
-
+
- +classmethod fromBirthYear(name, year)[source]¶ +
-
+
- Return type +
- + +
- Parameters +
-
+
name (str) –
+year (int) –
+
+