Experiment with advanced python features.
Topics
-
Basics
- type or isinstance
- built-in identifiers
- switch cases
-
Obect-Oriented
-
Special Methods
- __ new __
- __ slots __
- __ init __
-
Decorators:
- setter
- getter
- deleter
- property
-
Variables Scope
- class variables
- isntance variables
- shared class variable
- union of class and instance variable
-
Dataclasses:
- __ post_init __
- dataclass decorator
- dataclass features
- field
- asdict
- kw_only
-
NumPy
- __ array_finalize __
- view casting
- new from template
- add attributes
-
-
Logger
- add logs
- distinguish errors/warning/fyi
- assign numbering to logs
- print logs in order of datetime
- write logs in separate file
-
Containers
- enum
- named-tuple
-
Decorators
- closures
- function dec.
- class dec.
- stacked dec.
- parameterized dec.
- wrappers
-
Typing
- protocols
- runtime checkables
-
Context-Manager
- e.g. cwd
- e.g. file manager
-
Function-Tools
- partial
- e.g.