Python __del__() Magic Method

Python’s magic method __del__() is called the finalizer method or, wrongly, the destructor method — the latter being wrong because it doesn’t actually destroy the object. Python calls __del__() upon deletion of a given instance. For example, the expression del my_obj will eventually initiate my_obj.__del__(). We call this a “Dunder Method” for “Double Underscore Method” … Read more

Python Pass Statement

The pass statement does nothing when executed. You can use it as a placeholder for future code so that you can focus on the high-level structure first and implement the details later. For example, functions, loops, class definitions, or if statements require at least one statement in their indentation block. Think of the pass statement … Read more