It always has frustrated me to see that attribute- and dictionary access is so similar but still different. Of course in most cases, there are some good reasons to have it different -- but sometimes there are also good reasons to generalize access to some important values.
So, we have duck typing and car typing. And both together we have a duck-car, because it quacks like a duck and runs like a car.
It always has frustrated me to see that attribute- and dictionary access is so similar but still different. Of course in most cases, there are some good reasons to have it different -- but sometimes there are also good reasons to generalize access to some important values.
So, we have duck typing and car typing. And both together we have a duck-car, because it quacks like a duck and runs like a car.