sum() requires number, not simply __add__

Roy Smith roy at panix.com
Fri Feb 24 08:23:54 EST 2012


In article <mailman.123.1330083762.3037.python-list at python.org>,
 Antoon Pardon <antoon.pardon at rece.vub.ac.be> wrote:

> > Python doesn't try to prevent people from shooting themselves in the foot.
> >    
> Yes it does! A simple example is None as a keyword to prevent 
> assignments to it.

Hmmm.  Just playing around with some bizarre things to do with None, and 
discovered this:

>>> import sys as None

doesn't give an error, but also doesn't assign the module to the symbol 
'None'.  Weird.



More information about the Python-list mailing list