Skip to content

concepts

Jasper Zanjani edited this page Sep 14, 2020 · 2 revisions

Shebang

#!/usr/bin/env python

Debugging

Non-interactive debugging is the most basic form of debugging, dependent on print or log statements placed within the body of code.

Type object

The PyTypeObject structure defines a new type and are fundamental to Python's object data model. ionel's codelog This is a struct that describes the class. Each magic method has a field within this struct, which are called type slots.

  • __new__ method is the constructor
  • __init__ is the initializer
  • __prepare__ returns a dictionary-like object that's used as the local namespace for all the code from the class body.

MRO

The method resolution order (MRO) refers to the order of base classes that are searched when using super(). src It is accessed with __mro__, which returns a tuple of base classes in order of precedence, ending in object which is the root class of all classes.

Python virtual machine

Clone this wiki locally