Skip to content

Commit 1686075

Browse files
Merge pull request #2989 from enkidevs/advanced-referencing
Advanced referencing
2 parents d59ba10 + eea7652 commit 1686075

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,7 @@ Types of change:
479479
### Changed
480480
- [Html - Link Relative Paths - Change part of PQ as it wasn't worder properly](https://github.com/enkidevs/curriculum/pull/2985)
481481
- [Python - Format Text Paragraphs With Textwrap - Make the fill method more clear](https://github.com/enkidevs/curriculum/pull/2981)
482+
- [Python - Advanced Referencing - Move single-line commands to a single line, update indentation in codeblocks from 4 to 2 spaces](https://github.com/enkidevs/curriculum/pull/2989)
482483
- [Python - Python Recipes - Move single-line commands to a single line, update indentation in codeblocks from 4 to 2 spaces](https://github.com/enkidevs/curriculum/pull/3009)
483484
- [Python - Is Your Python Healthy - Move single-line commands to a single line, update indentation in codeblocks from 4 to 2 spaces](https://github.com/enkidevs/curriculum/pull/2999)
484485
- [Python - Memory Allocation - Move single-line commands to a single line, update indentation in codeblocks from 4 to 2 spaces, grammar improvements](https://github.com/enkidevs/curriculum/pull/3002)

python/python-core/advanced-referencing/context-manager-types-with.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ To implement a custom **context manager**, two methods must be implemented:
5656
```python
5757
class my_context_manager:
5858
def __enter__(self):
59-
# set up things
60-
return thing
59+
# set up things
60+
return thing
6161
def __exit__(self,type,value,traceback):
62-
# deal with unmanaged resources
62+
# deal with unmanaged resources
6363
#....
6464
with my_context_manager as custom_name
65-
# work with resources
65+
# work with resources
6666

6767
```
6868

@@ -80,14 +80,13 @@ Complete the code snippet to implement a context manager:
8080
```python
8181
class new_context_manager:
8282
def ???(self):
83-
# set up things
84-
return thing
85-
def ???(self, type,
86-
value, traceback):
87-
# deal with unmanaged resources
83+
# set up things
84+
return thing
85+
def ???(self, type, value, traceback):
86+
# deal with unmanaged resources
8887

8988
with new_context_manager as custom_name
90-
# work with resources
89+
# work with resources
9190
```
9291

9392
- `__enter__`

python/python-core/advanced-referencing/weakref-proxies.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ The difference is that proxies can be used without calling the `ref` first to ac
2929
import weakref
3030

3131
class Enki(object):
32-
def __init__(self, arg):
33-
self.arg = arg
32+
def __init__(self, arg):
33+
self.arg = arg
3434

3535
enki = Enki('arg')
3636
r = weakref.ref(enki)

0 commit comments

Comments
 (0)