From 40c4567c038c2c400a0562572f0bb798bb414a87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Wed, 27 Feb 2019 17:19:39 +0100 Subject: [PATCH] Introspection --- README.md | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index e84aa07..97186bb 100644 --- a/README.md +++ b/README.md @@ -1373,15 +1373,8 @@ Hashlib ``` -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** - +Introspection +------------- ### Variables ```python = dir() # Names of in-scope variables. @@ -1405,6 +1398,9 @@ no_of_params = len(sig.parameters) param_names = list(sig.parameters.keys()) ``` + +Metaprograming +-------------- ### Type **Type is the root class. If only passed the object it returns it's type (class). Otherwise it creates a new class (and not an instance!).**