What values are considered false?
Joshua Muskovitz
joshm at taconic.net
Wed Feb 20 21:14:54 EST 2002
> In my experimentation 0, None, "", [], and () all seem to be
> considered false. Just to confound me none of them are == to each
> other. Coming from a Scheme world this is confusing. Are there any
> other values that are false? Why aren't () and "" the same thing?
> Don't both describe an immutable sequence of values (basically, why
> aren't strings either lists or tuples)?
Both are valid questions.
Philosophically, I would say that () and "" are different because tuples can
contain objects of any type, while strings can only contain characters.
As for why 0, None, "", [], and () are not == each other, it is because each
has a type associated with it. Wouldn't you agree that objects of different
types are generally considered different?
--
# Joshua Muskovitz
# joshm at taconic.net
def lyyrs(sig): return '-'.join(sig.split()+["ly y'rs"])
lyyrs('Hire me! I need the work!')
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----
More information about the Python-list
mailing list