[Python-Dev] Re: [Python-checkins] python/dist/src/Doc/lib libfuncs.tex,1.134,1.135
Andrew Koenig
ark@research.att.com
12 Jun 2003 08:55:12 -0400
>> - bool() called without arguments now returns False rather than
>> raising an exception. This is consistent with calling the
>> constructors for the other builtin types -- called without argument
>> they all return the false value of that type. (SF patch #724135)
Greg> That's clearly useful for mutable types such as lists
Greg> and dicts, but for immutable types? Especially one such
Greg> as bool whose possible values are so, er, symmetrical
Greg> in prominence (is there a succinct word for this
Greg> concept?)
I think that if T is an unknown type, it would be nice for T() to be
meaningful in a similar way over as many values of T as possible
without special cases. One possible use might be to write type(x)()
for a canonical value of the same type as x.
--
Andrew Koenig, ark@research.att.com, http://www.research.att.com/info/ark