From ef79bdfaa08c3e726506acdf1a052c74a5f55ea8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Wed, 27 Jul 2022 20:49:52 +0200 Subject: [PATCH] Csv, Introspection --- README.md | 10 +++++----- index.html | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 72fd4d0..6049894 100644 --- a/README.md +++ b/README.md @@ -1829,7 +1829,7 @@ import csv * **`'delimiter'` - A one-character string used to separate fields.** * **`'quotechar'` - Character for quoting fields that contain special characters.** * **`'doublequote'` - Whether quotechars inside fields are/get doubled or escaped.** -* **`'skipinitialspace'` - Whether whitespace after delimiter gets stripped by reader.** +* **`'skipinitialspace'` - Is space character at the start of the field stripped by reader.** * **`'lineterminator'` - How writer terminates rows. Reader is hardcoded to '\n', '\r', '\r\n'.** * **`'quoting'` - 0: As necessary, 1: All, 2: All but numbers which are read as floats, 3: None.** * **`'escapechar'` - Character for escaping quotechars if doublequote is False.** @@ -2192,11 +2192,11 @@ delattr(, '') # Same. Also `del . = signature() # Function's Signature object. - = .parameters # Dict of function's Parameter objects. - = .name # Parameter's name. + = inspect.signature() # Function's Signature object. + = .parameters # Dict of Parameter objects. = .kind # Member of ParameterKind enum. + = .default # Default value or .empty. + = .annotation # Type or .empty. ``` diff --git a/index.html b/index.html index 1c30c04..769fd49 100644 --- a/index.html +++ b/index.html @@ -54,7 +54,7 @@
- +
@@ -1528,7 +1528,7 @@ CompletedProcess(args=['bc', 'delimiter' - A one-character string used to separate fields.
  • 'quotechar' - Character for quoting fields that contain special characters.
  • 'doublequote' - Whether quotechars inside fields are/get doubled or escaped.
  • -
  • 'skipinitialspace' - Whether whitespace after delimiter gets stripped by reader.
  • +
  • 'skipinitialspace' - Is space character at the start of the field stripped by reader.
  • 'lineterminator' - How writer terminates rows. Reader is hardcoded to '\n', '\r', '\r\n'.
  • 'quoting' - 0: As necessary, 1: All, 2: All but numbers which are read as floats, 3: None.
  • 'escapechar' - Character for escaping quotechars if doublequote is False.
  • @@ -1810,11 +1810,11 @@ setattr(<object>, '<attr_name>', va delattr(<object>, '<attr_name>') # Same. Also `del <object>.<attr_name>`. -

    Parameters

    from inspect import signature
    -<Sig>  = signature(<function>)             # Function's Signature object.
    -<dict> = <Sig>.parameters                  # Dict of function's Parameter objects.
    -<str>  = <Param>.name                      # Parameter's name.
    +

    Parameters

    <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 <Param>.empty.
    +<type> = <Param>.annotation                # Type or <Param>.empty.
     

    #Metaprogramming

    Code that generates code.

    Type

    Type is the root class. If only passed an object it returns its type (class). Otherwise it creates a new class.

    <class> = type('<class_name>', <tuple_of_parents>, <dict_of_class_attributes>)
    @@ -2905,7 +2905,7 @@ $ pyinstaller script.py --add-data '<path>:.'