Everything is data is data
Everything is data is data is data
You know where this is going
You know where this is going is
wait for it...
Everything is data is data is data is data
But what is meaning?
So Python is one of such (not so) abstract machines that accepts a strictly defined grammar (what we call syntax) and has a set of instructions it applies to data that conforms to this grammar.
>>> 2 + 2
4
>>> def freedom():
print(42)
>>> def 1984
SyntaxError: invalid syntaxObjects are Python’s abstraction for data.
Every object has an identity, a type and a value.
The value of some objects can change. Objects whose value can change are said to be mutable; objects whose value is unchangeable once they are created are called immutable.
An object’s type determines the operations that the object supports.
Objects are never explicitly destroyed; however, when they become unreachable they may be garbage-collected.
All data in a Python program is represented by objects or by relations between objects.
__init__
__del__
__repr__
__str__
__bytes__
__bool__
__getattr__
__add__
__mul__In this talk, we are going to focus on Python's "magic" methods that give us access to built-in operations.
git clone https://github.com/letroot/object-model.git