From 37d367ce4e316176c3b5ab644490e5c1d5bfcbb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Wed, 27 Nov 2024 02:27:50 +0100 Subject: [PATCH] Introspection --- README.md | 4 ++-- index.html | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 926e2c4..460fce6 100644 --- a/README.md +++ b/README.md @@ -2296,7 +2296,7 @@ Introspection ```python = dir() # List of local names (variables, funcs, classes, modules). = vars() # Dict of local names and their objects. Also locals(). - = globals() # Dict of global names (for instance '__builtin__' module). + = globals() # Dict of global names and their objects, e.g. __builtin__. ``` ```python @@ -2309,7 +2309,7 @@ delattr(, '') # Deletes attribute from __dict__. Also `del ``` ```python - = inspect.signature() # Returns function's Signature object. Can accept a class. + = inspect.signature() # Returns a Signature object of the passed function. = .parameters # Returns dict of Parameters. Also .return_annotation. = .kind # Returns ParameterKind member (Parameter.KEYWORD_ONLY, …). = .annotation # Returns Parameter.empty if missing. Also .default. diff --git a/index.html b/index.html index 56e24fc..47e63ce 100644 --- a/index.html +++ b/index.html @@ -55,7 +55,7 @@
- +
@@ -1879,7 +1879,7 @@ CRITICAL:my_module:Running out of disk space.

#Introspection

<list> = dir()                      # List of local names (variables, funcs, classes, modules).
 <dict> = vars()                     # Dict of local names and their objects. Also locals().
-<dict> = globals()                  # Dict of global names (for instance '__builtin__' module).
+<dict> = globals()                  # Dict of global names and their objects, e.g. __builtin__.
 
<list> = dir(<obj>)                 # Returns names of all object's attributes (incl. methods).
@@ -1889,7 +1889,7 @@ value  = getattr(<obj>, '<name>')
 setattr(<obj>, '<name>', value)     # Sets attribute. Only works on objects with __dict__ attr.
 delattr(<obj>, '<name>')            # Deletes attribute from __dict__. Also `del <obj>.<name>`.
 
-
<Sig>  = inspect.signature(<func>)  # Returns function's Signature object. Can accept a class.
+
<Sig>  = inspect.signature(<func>)  # Returns a Signature object of the passed function.
 <dict> = <Sig>.parameters           # Returns dict of Parameters. Also <Sig>.return_annotation.
 <memb> = <Param>.kind               # Returns ParameterKind member (Parameter.KEYWORD_ONLY, …).
 <type> = <Param>.annotation         # Returns Parameter.empty if missing. Also <Param>.default.
@@ -2923,7 +2923,7 @@ $ deactivate                # Deactivates the active