PEP 285: Adding a bool type

Gustavo Niemeyer niemeyer at conectiva.com
Mon Apr 1 10:12:04 EST 2002


Hi Martin!

> 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";

I hope nobody is planning to change "return None" to "return False".
This would break a lot of code doing "ret == None".

-- 
Gustavo Niemeyer

[ 2AAC 7928 0FBF 0299 5EB5  60E2 2253 B29A 6664 3A0C ]




More information about the Python-list mailing list