Theory Flashcards

1
Q

Bytecode

A

Python source code is compiled into bytecode, the internal representation of a Python program in the CPython interpreter. Bytecode is also cached in .pyc files. Bytecode runs on a virtual machine

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Class Definition Scope

A

Python creates a temporary namespace for the class to store class-level variables

unbound local variables are looked up in the global namespace

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

GIL

A

Global Interpreter Lock

mutex that allows only one thread to hold the control of the interpreter

only in CPython

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Garbage Collection

A

Reference Counting
tracking references
deallocating memory

Generational Garbage Collection
- generation 0 (youngest)
- generation 1 (middle-aged)
- generation 2 (oldest)

prioritizing younger objects
handling cyclic references

How well did you know this?
1
Not at all
2
3
4
5
Perfectly