"Dr. Phillip M. Feldman" <pfeld...@verizon.net> wrote in message
news:mailman.3644.1248417347.8015.python-l...@python.org...
Some aspects of the Python design are remarkably clever, while others
leave
me perplexed. Here's an example of the latter: Why does len() give an
error
when applied to an int or float? len() should always return something; in
particular, when applied to a scalar, it should return a value of 1.
So you want len() to treat 123 as though it could potentially be a list
containing a single element?
In that case there could be an ambiguity here:
print len([10,20,30])
Should it print 3 (the elements in [10,20,30]), or 1 (treating [10,20,30] as
a potential list containing the single element [10,20,30])?
--
bartc
--
http://mail.python.org/mailman/listinfo/python-list