diff --git a/README.md b/README.md index 3266166..926e2c4 100644 --- a/README.md +++ b/README.md @@ -2294,7 +2294,7 @@ CRITICAL:my_module:Running out of disk space. Introspection ------------- ```python - = dir() # List of of local names (including functions and classes). + = 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). ``` @@ -2304,7 +2304,7 @@ Introspection = vars() # Returns dict of writable attributes. Also .__dict__. = hasattr(, '') # Checks if object possesses attribute with passed name. value = getattr(, '') # Returns object's attribute or raises AttributeError. -setattr(, '', value) # Sets attribute. Only works on objects with __dict__. +setattr(, '', value) # Sets attribute. Only works on objects with __dict__ attr. delattr(, '') # Deletes attribute from __dict__. Also `del .`. ``` diff --git a/index.html b/index.html index f206fa8..56e24fc 100644 --- a/index.html +++ b/index.html @@ -1877,7 +1877,7 @@ CRITICAL:my_module:Running out of disk space. 2023-02-07 23:21:01,430 CRITICAL:my_module:Running out of disk space. -

#Introspection

<list> = dir()                      # List of of local names (including functions and classes).
+

#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).
 
@@ -1886,7 +1886,7 @@ CRITICAL:my_module:Running out of disk space. <dict> = vars(<obj>) # Returns dict of writable attributes. Also <obj>.__dict__. <bool> = hasattr(<obj>, '<name>') # Checks if object possesses attribute with passed name. value = getattr(<obj>, '<name>') # Returns object's attribute or raises AttributeError. -setattr(<obj>, '<name>', value) # Sets attribute. Only works on objects with __dict__. +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.