File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ Let's see how we can implement our own Context Manager. This should allow
36
36
us to understand exactly what's going on behind the scenes.
37
37
38
38
Implementing a Context Manager as a Class:
39
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
39
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
40
40
41
41
At the very least a context manager has an ``__enter__ `` and
42
42
``__exit__ `` method defined. Let's make our own file-opening Context
Original file line number Diff line number Diff line change @@ -273,7 +273,7 @@ Now let's take a look at the areas where decorators really shine and
273
273
their usage makes something really easy to manage.
274
274
275
275
Authorization
276
- ~~~~~~~~~~~~
276
+ ~~~~~~~~~~~~~
277
277
278
278
Decorators can help to check whether someone is authorized to use an
279
279
endpoint in a web application. They are extensively used in Flask web
@@ -296,7 +296,7 @@ authentication:
296
296
return decorated
297
297
298
298
Logging
299
- ~~~~~~~~~~~~
299
+ ~~~~~~~
300
300
301
301
Logging is another area where the decorators shine. Here is an example:
302
302
Original file line number Diff line number Diff line change 1
1
``for/else ``
2
- ----------
2
+ ------------
3
3
4
4
Loops are an integral part of any language. Likewise ``for `` loops are
5
5
an important part of Python. However there are a few things which most
@@ -22,7 +22,7 @@ That is the very basic structure of a ``for`` loop. Now let's move on to
22
22
some of the lesser known features of ``for `` loops in Python.
23
23
24
24
``else `` Clause
25
- ^^^^^^^^^^^^^^^^^^^^
25
+ ^^^^^^^^^^^^^^^
26
26
27
27
``for `` loops also have an ``else `` clause which most of us are unfamiliar
28
28
with. The ``else `` clause executes after the loop completes normally.
You can’t perform that action at this time.
0 commit comments