From 1b3ae093e88e6c7377b5da078a703f22a269dc95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Sun, 25 Mar 2018 15:57:20 +0200 Subject: [PATCH] Readme --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 69a338d..cae8c86 100644 --- a/README.md +++ b/README.md @@ -219,7 +219,7 @@ now.strftime('%Y%m%d%H%M%S') # 20180315002834 Arguments --------- -#### "*" is the splat operator, that takes a list as input, and expands it into actual positional arguments in the function call: +**"*" is the splat operator, that takes a list as input, and expands it into actual positional arguments in the function call:** ```python args = (1, 2) kwargs = {'x': 3, 'y': 4, 'z': 5} @@ -476,7 +476,7 @@ lock.release() Itertools --------- -#### Every function returns a generator and can accept any collection. If you want to print an output of generator, as in examples, you need to pass it to the list() function. +**Every function returns a generator and can accept any collection. If you want to print an output of generator, as in examples, you need to pass it to the list() function.** ```python from itertools import * @@ -544,17 +544,17 @@ islice([1, 2, 3], 1, None) ``` ### Ifilter, imap and izip -#### Filter, map and zip functions that return generators instead of iterators. +**Filter, map and zip functions that return generators instead of iterators.** Introspection and Metaprograming -------------------------------- #### Inspecting code at runtime and code that generates code. You can: -* Look at the attributes -* Set new attributes -* Create functions dynamically -* Traverse the parent classes -* Change values in the class +* **Look at the attributes** +* **Set new attributes** +* **Create functions dynamically** +* **Traverse the parent classes** +* **Change values in the class** ```python @@ -589,7 +589,7 @@ False ``` ### Type -#### Type is the root class. If only passed the object it returns it's type. Otherwise it creates a new class (and not the instance!): +**Type is the root class. If only passed the object it returns it's type. Otherwise it creates a new class (and not the instance!):** ```python type(class_name, parents, attributes) ``` @@ -615,7 +615,7 @@ class MyMetaClass(type): ``` ### Metaclass Attr -*When class is created it checks if it has metaclass defined. If not, it recursively checks if any of his parents has it defined, and eventually comes to type:* +**When class is created it checks if it has metaclass defined. If not, it recursively checks if any of his parents has it defined, and eventually comes to type:** ```python class BlaBla: __metaclass__ = Bla