|
1 | 1 | # Python course |
2 | 2 |
|
3 | | -## Chapter 1.1. Native datatypes |
| 3 | +## Chapter 1. Native datatypes |
4 | 4 |
|
5 | 5 | ### Module usage |
6 | 6 |
|
|
19 | 19 | * unicode string |
20 | 20 | * `r""` and `f""` forms |
21 | 21 |
|
| 22 | +### Files |
| 23 | + |
| 24 | +* `open` and `with` statement |
| 25 | +* `read()` - read all content |
| 26 | +* `readlines()` - read all lines |
| 27 | + |
| 28 | +### Chapter 2. Basic Collections |
| 29 | + |
22 | 30 | ### List |
23 | 31 |
|
24 | 32 | * mutable, single types elements |
|
37 | 45 | * `keys()` return set |
38 | 46 | * `values()` and `items()` return list |
39 | 47 |
|
40 | | -### Files |
41 | | - |
42 | | -* `open` and `with` statement |
43 | | -* `read()` - read all content |
44 | | -* `readlines()` - read all lines |
45 | | - |
46 | | -### Comprehensions |
47 | | - |
48 | | -#### List |
| 48 | +#### List Comprehensions |
49 | 49 |
|
50 | 50 | * list comprehension provides a compact way of mapping a list into another list |
51 | 51 | * filesystem comprehension example |
|
57 | 57 | * list comprehension in Python works by loading the entire output list into memory |
58 | 58 | * it’s often helpful to use a generator instead of a list comprehension in Python |
59 | 59 |
|
60 | | -#### Dict |
| 60 | +#### Dict Comprehensions |
61 | 61 |
|
62 | 62 | * dictionary comprehension similar to list comprehension, but it operates with key-value pairs |
63 | 63 | * swapping the keys and values of a dictionary example (value also must be hashable and unique) |
64 | 64 |
|
65 | | -## Chapter 2. Functions |
| 65 | +## Chapter 3. Functions |
66 | 66 |
|
67 | 67 | ### Function as object |
68 | 68 |
|
|
124 | 124 | * closures |
125 | 125 | * currying |
126 | 126 |
|
127 | | -## Chapter 3. Decorators |
| 127 | +## Chapter 4. Decorators |
128 | 128 |
|
129 | 129 | * definition of decorator: a callable high-order function that takes a callable as input and returns another callable |
130 | 130 | * replacing __`name`__, __`doc`__, and __`module`__ of the decorator with respected values of the decorated function |
|
137 | 137 | * decorator that prevent calling function twice with the same arguments |
138 | 138 | * using decorators for debugging, logging and profiling |
139 | 139 |
|
140 | | -## Chapter 4. Input/Output |
| 140 | +## Chapter 5. Input/Output |
141 | 141 |
|
142 | 142 | ### Encoding |
143 | 143 |
|
|
172 | 172 | * object string representation with `__repr__()` and `__str__()` methods |
173 | 173 | * string case conversion with `upper()`, `lower()`, `capitalize()`, `title()`, `swapcase()` methods |
174 | 174 |
|
175 | | -## Chapter 5. Collections |
| 175 | +## Chapter 6. Additional Collections |
176 | 176 |
|
177 | 177 | * thread-safe queues: `queue.Queue`, `queue.LifoQueue` |
178 | 178 | * deque: `collections.deque` |
179 | 179 | * priority queue: `heapq`, `queue.PriorityQueue` |
180 | 180 | * tuples: `collections.namedtuple`, `collections.Counter` |
181 | 181 | * dictionaries: `collections.defaultdict`, `collections.OrderedDict`, `collections.ChainMap` |
182 | 182 |
|
183 | | -## Chapter 6. Classes |
| 183 | +## Chapter 7. Classes |
184 | 184 |
|
185 | 185 | ### Class Definition |
186 | 186 |
|
|
269 | 269 | * async callable: `__acall__` |
270 | 270 |
|
271 | 271 |
|
272 | | -## Chapter 7. Exceptions |
| 272 | +## Chapter 8. Exceptions |
273 | 273 |
|
274 | 274 | ### Exception Theory |
275 | 275 |
|
|
377 | 377 | * the `pdb` module provides a built-in debugger for tracing errors and debugging code interactively |
378 | 378 | * `pdb.set_trace()` enters debugger interactive mode |
379 | 379 |
|
380 | | -## Chapter 8. Iterators |
| 380 | +## Chapter 9. Iterators |
381 | 381 |
|
382 | 382 | TBC |
0 commit comments