[Python-Dev] bool() without arguments

Aahz aahz@pythoncraft.com
Thu, 12 Jun 2003 07:36:31 -0400


On Thu, Jun 12, 2003, Greg Ewing wrote:
>
>> - 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)
> 
> That's clearly useful for mutable types such as lists and dicts, but
> for immutable types? Especially one such as bool whose possible values
> are so, er, symmetrical in prominence (is there a succinct word for
> this concept?)
>
> Does anyone have a use case for this?

Generic usage of type constructors?  If yes, that would argue for an
extension of PEP 8.

(Should the error message if people don't agree say something like,
"That's not an argument, that's abuse.")
-- 
Aahz (aahz@pythoncraft.com)           <*>         http://www.pythoncraft.com/

"If you don't know what your program is supposed to do, you'd better not
start writing it."  --Dijkstra