Dunder Wonder
Python Magic Methods
Topics Covered
Global special variables (__name__, __all__, etc)
Private and Protected Methods
Magic Methods
Terminology
Under (_) and Dunder (__) methods
_asdict, __supersecretmethod, __eq__
Duck Typing
If it walks like a duck and quacks like a duck, then it must be a duck
Global Variables
Special Global Variables
if __name__ == ‘__main__’:
pass # Do something
Private and Protected Methods
Private Methods
Protected Methods
Magic Methods
Magic Methods
Questions?
Magic Methods, cont