+
+ +
+

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 MySuperClass1[source]
+

Bases: object

+
+ +
+
+class MySuperClass2[source]
+

Bases: object

+
+ +
+
+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'
+
+ +
+
+__str__()[source]
+

La methode __str__ doit toujours retourner “str”

+
+
Return type
+

str

+
+
+
+ +
+
+my_method2(a, b)[source]
+
+
Return type
+

None

+
+
Parameters
+
    +
  • a (int) –

  • +
  • b (float) –

  • +
+
+
+
+ +
+ +
+
+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:

+
    +
  1. Classic Constructor :

  2. +
+
>>> person1 = Person('Alfredo', 21)
+
+
+
    +
  1. Class method (Factory) :

  2. +
+
>>> person2 = Person.fromBirthYear('Peter', 2000)
+>>> person2.age
+22
+
+
+
    +
  1. Another class method (Factory) :

  2. +
+
>>> person3 = Person.twin('John', person2)
+>>> person3.age == person2.age
+True
+>>> person3.name == person2.name
+False
+
+
+
    +
  1. Static method (does not need access to the class attributes or methods) :

  2. +
+
>>> Person.isAdult(22)
+True
+
+
+
+
Parameters
+
    +
  • name (str) –

  • +
  • age (int) –

  • +
+
+
Return type
+

None

+
+
+
+
+classmethod fromBirthYear(name, year)[source]
+
+
Return type
+

Person

+
+
Parameters
+
    +
  • name (str) –

  • +
  • year (int) –

  • +
+
+
+
+ +
+
+classmethod twin(name, p)[source]
+
+
Return type
+

Person

+
+
Parameters
+
+
+
+
+ +
+
+static isAdult(age)[source]
+
+
Parameters
+

age (int) –

+
+
+
+ +
+ +
+
+main()[source]
+

Comment on Main function definition

+
+
Return type
+

None

+
+
+
+ +
+ + +
+ +