diff --git a/README.md b/README.md index 446938e..e211652 100644 --- a/README.md +++ b/README.md @@ -2148,10 +2148,10 @@ Introspection ``` ```python - = hasattr(, '') -value = getattr(, '') -setattr(, '', value) -delattr(, '') + = hasattr(, '') # Checks if getattr raises an error. +value = getattr(, '') # Raises AttributeError if attribute is missing. +setattr(, '', value) # Only works on user-defined classes. +delattr(, '') # Equivalent to `del .`. ``` ### Parameters @@ -2384,7 +2384,7 @@ def draw(screen): curs_set(0) # Makes cursor invisible. screen.nodelay(True) # Makes getch() non-blocking. screen.clear() - screen.addstr(0, 0, 'Press ESC to quit.') + screen.addstr(0, 0, 'Press ESC to quit.') # Coordinates are y, x. while screen.getch() != ascii.ESC: pass diff --git a/index.html b/index.html index 944617d..d50d5e1 100644 --- a/index.html +++ b/index.html @@ -1880,10 +1880,10 @@ last_el = op.methodcaller('pop')(<l <dict> = vars(<object>) # Dict of object's fields. Also <obj>.__dict__. -
<bool> = hasattr(<object>, '<attr_name>')
-value  = getattr(<object>, '<attr_name>')
-setattr(<object>, '<attr_name>', value)
-delattr(<object>, '<attr_name>')
+
<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 user-defined classes.
+delattr(<object>, '<attr_name>')           # Equivalent to `del <object>.<attr_name>`.
 

Parameters

from inspect import signature
 <sig>        = signature(<function>)
@@ -2061,7 +2061,7 @@ pyplot.clf()                                   # Clea
     curs_set(0)                                # Makes cursor invisible.
     screen.nodelay(True)                       # Makes getch() non-blocking.
     screen.clear()
-    screen.addstr(0, 0, 'Press ESC to quit.')
+    screen.addstr(0, 0, 'Press ESC to quit.')  # Coordinates are y, x.
     while screen.getch() != ascii.ESC:
         pass