On 12/13/18 11:15 PM, Avi Gross wrote:
> Steven,
> 
> There are dunderheads who will maliciously misuse things. Yes, we know what
> __add__ is supposed to do. But if someone codes a class with one that
> ignores addition to a collection if it has reached a maximum size, or does
> addition modulo 16 or makes it play a happy birthday tune, while
> subtracting, it may not be trivial for the innocent user of your code to
> make much sense of it. 
> 
> There are documented IDEAS about what many of those dunder methods might
> mean but no enforcement. 

As Raymond Hettinger likes to say, Python is a Consenting Adults
language.  You're not prevented from doing things, even if it might
outrage a few...


_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to