[Python-Dev] For review: PEP 285: Adding a bool type

Samuele Pedroni pedroni@inf.ethz.ch
Fri, 8 Mar 2002 21:10:05 +0100


Hi,

Question: what will happen with all the return 1 or return 0 etc 
in the std lib and in user code and in the inline doc
and docs?

(I have found 167 return 1 in the std lib and 176
return 0,
and also code like this

    if os.name == 'mac':
        # The macintosh will select a listening socket for
        # write if you let it.  What might this mean?
        def writable (self):
            return not self.accepting
    else:
        def writable (self):
            return 1

which unchanged will define a bool vs int
function.)

There are function in the std lib that return 1 on success,
0 on failure. Are there function that do the contrary
like unix calls? Should these return True and False now.
Maybe not? In distutil code I have seen at least
one function documented as returning 'true'
on success.

Then there are really predicate function/methods,
they should probably be changed?
but that means that the situation for the
user will be *ideally* less muddy only when all
the code uses True/False everytime it makes sense,
and not 1/0.

regards.