F
Felipe Almeida Lessa
Em Seg, 2006-03-27 Ã s 21:05 -0500, Dan Sommers escreveu:
Sorry for being so --quiet. I will try to be more --verbose.
I can think of two types of constants:
1) Those defined in the language, like True, None, 0 and the like.
2) Those defined on your code.
You said type 1 can be used with "is", you're right:False
I said type 2 can (maybe "should"?) be used with "is", and AFAICT I'm
right as well:True
That said, you can do thinks like:True
That kind of constants can be used with "is". But if don't want to be
prone to errors as I do, use "is" only when you really know for sure
that you're dealing with singletons.
HTH,
Right off the top of my head, I can't think of a way to make "a = b; a
is b" return False.
Sorry for being so --quiet. I will try to be more --verbose.
I can think of two types of constants:
1) Those defined in the language, like True, None, 0 and the like.
2) Those defined on your code.
You said type 1 can be used with "is", you're right:False
I said type 2 can (maybe "should"?) be used with "is", and AFAICT I'm
right as well:True
That said, you can do thinks like:True
That kind of constants can be used with "is". But if don't want to be
prone to errors as I do, use "is" only when you really know for sure
that you're dealing with singletons.
HTH,