David Binger wrote:
> I like to know that attribute assignment will not raise an exception,
Why? There's a philosophy in C/Java that certain operations should not
cause exceptions, which is why the operators (==, +, [], etc) are
restricted to primitive types. But that leads to ghastly constructs like:
string1.lessThan(string2) # string1 < string2
substr(s, 1, 3) # s[1:4]
vector_.set(1, 2.0) # float_[1] = 2.0
These enforce an arbitrary rule ("operators should not raise exceptions")
at the expense of readability. I just assume that exceptions may occur at
any point in a program. What's the harm in having to remember that
'session.user = me' might raise an exception?