diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ce68702f7..5e5b738dca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -479,6 +479,7 @@ Types of change: ### Changed - [Html - Link Relative Paths - Change part of PQ as it wasn't worder properly](https://github.com/enkidevs/curriculum/pull/2985) - [Python - Format Text Paragraphs With Textwrap - Make the fill method more clear](https://github.com/enkidevs/curriculum/pull/2981) +- [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) - [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) - [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) - [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) diff --git a/python/python-core/advanced-referencing/context-manager-types-with.md b/python/python-core/advanced-referencing/context-manager-types-with.md index f6692adf6c..c888d80fcb 100644 --- a/python/python-core/advanced-referencing/context-manager-types-with.md +++ b/python/python-core/advanced-referencing/context-manager-types-with.md @@ -56,13 +56,13 @@ To implement a custom **context manager**, two methods must be implemented: ```python class my_context_manager: def __enter__(self): - # set up things - return thing + # set up things + return thing def __exit__(self,type,value,traceback): - # deal with unmanaged resources + # deal with unmanaged resources #.... with my_context_manager as custom_name - # work with resources + # work with resources ``` @@ -80,14 +80,13 @@ Complete the code snippet to implement a context manager: ```python class new_context_manager: def ???(self): - # set up things - return thing - def ???(self, type, - value, traceback): - # deal with unmanaged resources + # set up things + return thing + def ???(self, type, value, traceback): + # deal with unmanaged resources with new_context_manager as custom_name - # work with resources + # work with resources ``` - `__enter__` diff --git a/python/python-core/advanced-referencing/weakref-proxies.md b/python/python-core/advanced-referencing/weakref-proxies.md index 7c3e2b0a97..4e04c6d1c3 100644 --- a/python/python-core/advanced-referencing/weakref-proxies.md +++ b/python/python-core/advanced-referencing/weakref-proxies.md @@ -29,8 +29,8 @@ The difference is that proxies can be used without calling the `ref` first to ac import weakref class Enki(object): - def __init__(self, arg): - self.arg = arg + def __init__(self, arg): + self.arg = arg enki = Enki('arg') r = weakref.ref(enki)