8 ms·
In a way, almost everything in Python is a dictionary. But I see your point. API design would be tricky to do without classes, but what is stopping us from mak
by wheelerof4te 5y ago
In a way, almost everything in Python is a dictionary. But I see your point.
API design would be tricky to do without classes, but what is stopping us from making typed dictionaries? If I'm not mistaken, something similar already exists in stdlib.
Anyway, my intention was not to argue future design of Python. I just believe that writting classes complicates the overal program design, leading to unpythonic code.
- kazinator 5y agoYes, there is a really stupid thing you can do in Python, which is to add a property to an existing object, which is then available via obj.name syntax. It's not declared in a class or anything.