-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
27 lines (24 loc) · 834 Bytes
/
Copy path__init__.py
File metadata and controls
27 lines (24 loc) · 834 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""
Exceptions Can Not Be Ignored
-> Error coded are easy to ignore
-> Checks are always required
"""
"""
Use Standard Exception Types
-> Standard types: Python provides standard exceptions types for signalling common errors.
-> Invalid argument values: Use ValueError for arguments of the right type but with an invalid value
-> Exception constructors: Use raise ValueError() to raise a new ValueError
"""
"""
Exceptions and Protocols
-> Sequences should raise IndexError for out-of-bounds indexing.
-> Exceptions must be implemented and documented correctly.
-> Existing built-in exceptions are ofter the right ones to use.
"""
"""
Summary:
-> Raising an exception interrupts program flow.
-> Handle exceptions with try...except
-> Exceptions can be detected within try-blocks
-> Except-blocks define handlers for exceptions
"""