Browse Source

Update notes, session 9

master
Dimitri Merejkowsky 5 years ago
parent
commit
ee763e53c9
2 changed files with 16 additions and 8 deletions
  1. +14
    -8
      notes.md
  2. +2
    -0
      sessions/python-09.md

+ 14
- 8
notes.md View File

@@ -2,21 +2,24 @@ Ce fichier contient diverses notes utiles à la préparation des futurs cours.


# Sujets à évoquer # Sujets à évoquer


## next chapter
## bits


* Let's create *explicit* hidden interfaces!
### classes
* constants are UPPER_CASE
* multiple inheritance
* delegation
* properties on classes
* isinstance
* * several `__init__` ? Nope, alternative constructors
* https://code-maven.com/slides/python-programming/class-methods-alternative-constructor private
* magical methods: __str__, __repr__, __add__, ...


## bits
### rest


* base class / derived class -> more vocabulary
* attributes on functions (you never know) * attributes on functions (you never know)
* `__call__`, functors * `__call__`, functors
* scopes, closures, global, nonlocal * scopes, closures, global, nonlocal
* private
* no overlaod in python * no overlaod in python
* several `__init__` ? Nope, alternative constructors
* https://code-maven.com/slides/python-programming/class-methods-alternative-constructor
* properties on classes
* stable sorts * stable sorts
* dict: setdefault * dict: setdefault
* listes: pop prend un argument * listes: pop prend un argument
@@ -35,6 +38,9 @@ Ce fichier contient diverses notes utiles à la préparation des futurs cours.
* packages, libraries tierces * packages, libraries tierces
* requests, HTTP protocol (headers, methodes, urls, anchors, links ...) * requests, HTTP protocol (headers, methodes, urls, anchors, links ...)


* design patters
* solid

* décorateurs * décorateurs


* regular expressions * regular expressions


+ 2
- 0
sessions/python-09.md View File

@@ -241,6 +241,8 @@ class B(A):
self.attribute_in_a # ok self.attribute_in_a # ok
``` ```


On dit aussi que A est la classe *de base* et B la classe *dérivée*.

# Héritage - ordre de résolution des méthodes # Héritage - ordre de résolution des méthodes


```python ```python