From 0bb5d4460d08f776b3dfd29b4ed37c8ec39a609f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Sun, 5 May 2024 11:53:43 +0200 Subject: [PATCH] Enum, Exceptions --- README.md | 5 ++--- index.html | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 87263ea..281fe39 100644 --- a/README.md +++ b/README.md @@ -1340,8 +1340,8 @@ class (Enum): = # Values don't have to be hashable. = , # Tuple can be used for multiple values. ``` -* **Accessing a member named after a reserved keyword causes SyntaxError.** * **Methods receive the member they were called on as the 'self' argument.** +* **Accessing a member named after a reserved keyword causes SyntaxError.** ```python = . # Returns a member. @@ -1402,8 +1402,7 @@ finally: ``` * **Code inside the `'else'` block will only be executed if `'try'` block had no exceptions.** * **Code inside the `'finally'` block will always be executed (unless a signal is received).** -* **All variables that are initialized in executed blocks are also visible in all subsequent blocks -, as well as outside the try statement (only function block delimits scope).** +* **All variables that are initialized in executed blocks are also visible in all subsequent blocks, as well as outside the try statement (only function block delimits scope).** * **To catch signals use `'signal.signal(signal_number, )'`.** ### Catching Exceptions diff --git a/index.html b/index.html index fc1f589..01492a2 100644 --- a/index.html +++ b/index.html @@ -1145,8 +1145,8 @@ Hello World! <member_name> = <value>, <value> # Tuple can be used for multiple values.
    -
  • Accessing a member named after a reserved keyword causes SyntaxError.
  • Methods receive the member they were called on as the 'self' argument.
  • +
  • Accessing a member named after a reserved keyword causes SyntaxError.
<member> = <enum>.<member_name>         # Returns a member.
 <member> = <enum>['<member_name>']      # Returns a member. Raises KeyError.
@@ -1193,8 +1193,7 @@ LogicOp = Enum('LogicOp', {'else' block will only be executed if 'try' block had no exceptions.
 
  • Code inside the 'finally' block will always be executed (unless a signal is received).
  • -
  • All variables that are initialized in executed blocks are also visible in all subsequent blocks -, as well as outside the try statement (only function block delimits scope).
  • +
  • All variables that are initialized in executed blocks are also visible in all subsequent blocks, as well as outside the try statement (only function block delimits scope).
  • To catch signals use 'signal.signal(signal_number, <func>)'.
  • Catching Exceptions

    except <exception>: ...