Python's most DISLIKED __dunder__ (and what to use instead)

Python's most DISLIKED __dunder__ (and what to use instead)

103.984 Lượt nghe
Python's most DISLIKED __dunder__ (and what to use instead)
What is your least favorite? What is the most universally despised __dunder__ method in Python? It's __del__! From it's non-obvious relationship with del, to it's exception-ignoring behavior, to the uncertainty of whether the interpreter will call it 0 or multiple times, it's a real mess! ― mCoding with James Murphy (https://mcoding.io) Source code: https://github.com/mCodingLLC/VideosSampleCode with statement docs: https://docs.python.org/3/reference/compound_stmts.html#with dunder del docs: https://docs.python.org/3/reference/datamodel.html?#object.__del__ weakref docs: https://docs.python.org/3/library/weakref.html Plus equals video: https://youtu.be/cGveIvwwSq4 Dunder new video: https://youtu.be/-zsV0_QrfTw Metaclasses video: https://youtu.be/yWzMiaqnpkI SUPPORT ME ⭐ --------------------------------------------------- Patreon: https://patreon.com/mCoding Paypal: https://www.paypal.com/donate/?hosted_button_id=VJY5SLZ8BJHEE Other donations: https://mcoding.io/donate Top patrons and donors: Jameson, Laura M, Vahnekie, Dragos C, Matt R, Casey G, Johan A, John Martin, Jason F, Mutual Information, Neel R BE ACTIVE IN MY COMMUNITY 😄 --------------------------------------------------- Discord: https://discord.gg/Ye9yJtZQuN Github: https://github.com/mCodingLLC/ Reddit: https://www.reddit.com/r/mCoding/ Facebook: https://www.facebook.com/james.mcoding