diff --git a/README.md b/README.md index c86b86a..1c0737c 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Contents **   ** **3. Syntax:** **         ** **[`Args`](#arguments)**__,__ **[`Inline`](#inline)**__,__ **[`Import`](#imports)**__,__ **[`Decorator`](#decorator)**__,__ **[`Class`](#class)**__,__ **[`Duck_Types`](#duck-types)**__,__ **[`Enum`](#enum)**__,__ **[`Exception`](#exceptions)**__.__ **   ** **4. System:** **        ** **[`Exit`](#exit)**__,__ **[`Print`](#print)**__,__ **[`Input`](#input)**__,__ **[`Command_Line_Arguments`](#command-line-arguments)**__,__ **[`Open`](#open)**__,__ **[`Path`](#paths)**__,__ **[`OS_Commands`](#os-commands)**__.__ **   ** **5. Data:** **             ** **[`JSON`](#json)**__,__ **[`Pickle`](#pickle)**__,__ **[`CSV`](#csv)**__,__ **[`SQLite`](#sqlite)**__,__ **[`Bytes`](#bytes)**__,__ **[`Struct`](#struct)**__,__ **[`Array`](#array)**__,__ **[`Memory_View`](#memory-view)**__,__ **[`Deque`](#deque)**__.__ -**   ** **6. Advanced:** **   ** **[`Threading`](#threading)**__,__ **[`Operator`](#operator)**__,__ **[`Match_Stmt`](#match-statement)**__,__ **[`Introspection`](#introspection)**__,__ **[`Logging`](#logging)**__,__ **[`Coroutines`](#coroutines)**__.__ +**   ** **6. Advanced:** **   ** **[`Threading`](#threading)**__,__ **[`Operator`](#operator)**__,__ **[`Match_Stmt`](#match-statement)**__,__ **[`Logging`](#logging)**__,__ **[`Introspection`](#introspection)**__,__ **[`Coroutines`](#coroutines)**__.__ **   ** **7. Libraries:** **      ** **[`Progress_Bar`](#progress-bar)**__,__ **[`Plots`](#plot)**__,__ **[`Tables`](#table)**__,__ **[`Curses`](#curses)**__,__ **[`GUIs`](#pysimplegui)**__,__ **[`Scraping`](#scraping)**__,__ **[`Web`](#web)**__,__ **[`Profiling`](#profiling)**__.__ **   ** **8. Multimedia:** **  ** **[`NumPy`](#numpy)**__,__ **[`Image`](#image)**__,__ **[`Animation`](#animation)**__,__ **[`Audio`](#audio)**__,__ **[`Synthesizer`](#synthesizer)**__,__ **[`Pygame`](#pygame)**__,__ **[`Pandas`](#pandas)**__,__ **[`Plotly`](#plotly)**__.__ @@ -2037,6 +2037,7 @@ from array import array = array('', ) # Array from collection of numbers. = array('', ) # Array from bytes object. = array('', ) # Treats array as a sequence of numbers. +.fromfile(, n_items) # Appends items. Raises EOFError on end. = bytes() # Or: .tobytes() .write() # Writes array to the binary file. ``` @@ -2224,32 +2225,6 @@ match : ``` -Introspection -------------- -```python - = dir() # Names of local variables, functions, classes, etc. - = vars() # Dict of local variables, etc. Also locals(). - = globals() # Dict of global vars, etc. (incl. '__builtins__'). -``` - -```python - = dir() # Names of object's attributes (including methods). - = vars() # Dict of writable attributes. Also .__dict__. - = hasattr(, '') # Checks if getattr() raises an AttributeError. -value = getattr(, '') # Raises AttributeError if attribute is missing. -setattr(, '', value) # Only works on objects with '__dict__' attribute. -delattr(, '') # Same. Also `del .`. -``` - -```python - = inspect.signature() # Function's Signature object. - = .parameters # Dict of Parameter objects. - = .kind # Member of ParameterKind enum. - = .default # Default value or Parameter.empty. - = .annotation # Type or Parameter.empty. -``` - - Logging ------- ```python @@ -2303,6 +2278,32 @@ CRITICAL:my_module:Running out of disk space. ``` +Introspection +------------- +```python + = dir() # Names of local variables, functions, classes, etc. + = vars() # Dict of local variables, etc. Also locals(). + = globals() # Dict of global vars, etc. (incl. '__builtins__'). +``` + +```python + = dir() # Names of object's attributes (including methods). + = vars() # Dict of writable attributes. Also .__dict__. + = hasattr(, '') # Checks if getattr() raises an AttributeError. +value = getattr(, '') # Raises AttributeError if attribute is missing. +setattr(, '', value) # Only works on objects with '__dict__' attribute. +delattr(, '') # Same. Also `del .`. +``` + +```python + = inspect.signature() # Function's Signature object. + = .parameters # Dict of Parameter objects. + = .kind # Member of ParameterKind enum. + = .default # Default value or Parameter.empty. + = .annotation # Type or Parameter.empty. +``` + + Coroutines ---------- * **Coroutines have a lot in common with threads, but unlike threads, they only give up control when they call another coroutine and they don’t use as much memory.** diff --git a/index.html b/index.html index 4f71a56..8c3eebe 100644 --- a/index.html +++ b/index.html @@ -54,7 +54,7 @@
- +
@@ -85,7 +85,7 @@ '3. Syntax': [Args, Inline, Import, Decorator, Class, Duck_Types, Enum, Exception], '4. System': [Exit, Print, Input, Command_Line_Arguments, Open, Path, OS_Commands], '5. Data': [JSON, Pickle, CSV, SQLite, Bytes, Struct, Array, Memory_View, Deque], - '6. Advanced': [Threading, Operator, Match_Stmt, Introspection, Logging, Coroutines], + '6. Advanced': [Threading, Operator, Match_Stmt, Logging, Introspection, Coroutines], '7. Libraries': [Progress_Bar, Plots, Tables, Curses, GUIs, Scraping, Web, Profiling], '8. Multimedia': [NumPy, Image, Animation, Audio, Synthesizer, Pygame, Pandas, Plotly] } @@ -1685,6 +1685,7 @@ CompletedProcess(args=['bc', '<typecode>', <collection>) # Array from collection of numbers. <array> = array('<typecode>', <bytes>) # Array from bytes object. <array> = array('<typecode>', <array>) # Treats array as a sequence of numbers. +<array>.fromfile(<file>, n_items) # Appends items. Raises EOFError on end. <bytes> = bytes(<array>) # Or: <array>.tobytes() <file>.write(<array>) # Writes array to the binary file. @@ -1835,24 +1836,6 @@ first_element = op.methodcaller('pop', 'README.md is a readme file that belongs to user gto.' -

#Introspection

<list> = dir()                             # Names of local variables, functions, classes, etc.
-<dict> = vars()                            # Dict of local variables, etc. Also locals().
-<dict> = globals()                         # Dict of global vars, etc. (incl. '__builtins__').
-
- -
<list> = dir(<object>)                     # Names of object's attributes (including methods).
-<dict> = vars(<object>)                    # Dict of writable attributes. Also <obj>.__dict__.
-<bool> = hasattr(<object>, '<attr_name>')  # Checks if getattr() raises an AttributeError.
-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>')           # Same. Also `del <object>.<attr_name>`.
-
-
<Sig>  = inspect.signature(<function>)     # Function's Signature object.
-<dict> = <Sig>.parameters                  # Dict of Parameter objects.
-<memb> = <Param>.kind                      # Member of ParameterKind enum.
-<obj>  = <Param>.default                   # Default value or Parameter.empty.
-<type> = <Param>.annotation                # Type or Parameter.empty.
-

#Logging

import logging
 
@@ -1896,6 +1879,24 @@ 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()                             # Names of local variables, functions, classes, etc.
+<dict> = vars()                            # Dict of local variables, etc. Also locals().
+<dict> = globals()                         # Dict of global vars, etc. (incl. '__builtins__').
+
+ +
<list> = dir(<object>)                     # Names of object's attributes (including methods).
+<dict> = vars(<object>)                    # Dict of writable attributes. Also <obj>.__dict__.
+<bool> = hasattr(<object>, '<attr_name>')  # Checks if getattr() raises an AttributeError.
+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>')           # Same. Also `del <object>.<attr_name>`.
+
+
<Sig>  = inspect.signature(<function>)     # Function's Signature object.
+<dict> = <Sig>.parameters                  # Dict of Parameter objects.
+<memb> = <Param>.kind                      # Member of ParameterKind enum.
+<obj>  = <Param>.default                   # Default value or Parameter.empty.
+<type> = <Param>.annotation                # Type or Parameter.empty.
+

#Coroutines