Memory and Internals

How Python runs your code, frees memory, imports modules and looks up attributes.

  1. 01

    The Main Guard

    • easy
    • Pro
  2. 02

    What Happens When You Run Python

    • easy
    • Pro
  3. 03

    How Python Frees Memory

    • easy
    • Pro
  4. 04

    Reference Cycles and the Garbage Collector

    • medium
    • Pro
  5. 05

    Weak References

    • medium
    • Pro
  6. 06

    Slots to Save Memory

    • medium
    • Pro
  7. 07

    Find a Memory Leak in Python

    • medium
    • Pro
  8. 08

    Why a Python Loop Is Slow

    • medium
    • Pro
  9. 09

    New Versus Init

    • medium
    • Pro
  10. 10

    Circular Imports

    • medium
    • Pro
  11. 11

    Getattr or Getattribute?

    • hard
    • Pro
  12. 12

    Descriptors

    • hard
    • Pro
  13. 13

    Metaclasses

    • hard
    • Pro