PEP 285: Adding a bool type

Martin v. Loewis martin at v.loewis.de
Sat Mar 30 12:19:23 EST 2002


Peter Hansen <peter at engcorp.com> writes:

> Are there code snippets which clearly have significantly improved
> readability as a result of a rewrite using the proposed bool?

The standard library has 110 occurrences of "return 0", 70 occurrences
of "return 1", and 136 occurrences of "return None". Optimistically,
this makes 300 functions. It would help users of these 300 functions
if they would know whether those functions return a boolean or an
integral value (if integral, what range?); for the "return None"
cases, the boolean type would help to clarify whether this is "return
no value", "return False", or "return nil object";

Regards,
Martin




More information about the Python-list mailing list