default arguments newbie question

Erik Max Francis max at alcyone.com
Wed Jan 10 23:33:29 EST 2001


Mike Fletcher wrote:

> To expand on that "fundamental types" qualification...
> 
> class NULL:
>     def __cmp__( self, other ):
>         if other:
>            return -1
>         else:
>            return 0
> 
> Will break the assumption that x == None means x is None.  That is,
> NULLs
> will equate to any "false" value, including None, but would not match
> with
> an "is" test.

Well, sure, you can come up with pathological cases, but as you say, it
isn't terribly important as a serious technical objection.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ We grow in time to trust the future for our answers.
\__/ Ruth Benedict
    Official Buh rules / http://www.alcyone.com/max/projects/cards/buh/
 The official rules to the betting card game, Buh.



More information about the Python-list mailing list