diff --git a/README.md b/README.md index f4d14f8..90145d3 100644 --- a/README.md +++ b/README.md @@ -2142,9 +2142,6 @@ Introspection ```python = dir() # Names of object's attributes (incl. methods). = vars() # Dict of object's fields. Also .__dict__. -``` - -```python = hasattr(, '') # Checks if getattr() raises an error. value = getattr(, '') # Raises AttributeError if attribute is missing. setattr(, '', value) # Only works on objects with __dict__ attribute. diff --git a/index.html b/index.html index 3832124..8cd8033 100644 --- a/index.html +++ b/index.html @@ -1875,13 +1875,12 @@ last_el = op.methodcaller('pop')(<l

Attributes

<list> = dir(<object>)                     # Names of object's attributes (incl. methods).
 <dict> = vars(<object>)                    # Dict of object's fields. Also <obj>.__dict__.
-
- -
<bool> = hasattr(<object>, '<attr_name>')  # Checks if getattr() raises an error.
+<bool> = hasattr(<object>, '<attr_name>')  # Checks if getattr() raises an error.
 value  = getattr(<object>, '<attr_name>')  # Raises AttributeError if attribute is missing.
 setattr(<object>, '<attr_name>', value)    # Only works on objects with __dict__ attribute.
 delattr(<object>, '<attr_name>')           # Equivalent to `del <object>.<attr_name>`.
-
+ +

Parameters

from inspect import signature
 <sig>        = signature(<function>)
 no_of_params = len(<sig>.parameters)