#python - Sun 18 Feb 2007 between 19:24 and 19:28

NY Lost Funds



chrisjwnemesis128 - in your first example, this is how your argument was evaluated:::
triplah_wuse it when you want to see if one object is exactly the other object, not similar, not the same. only the ACTUAL object
chrisjw""" Dict is Dict.has_key('key') """
but if you specify parenthesis, it evaluates in the order you specify
nemesis128triplah_w, I know that
triplah_w>>> 499+1 is 500
False
chrisjwyes, that's the same
it's comparing 1 with 500
triplah_wno it isnt
nemesis128ha ok.
chrisjwyou need to use parenthesis
marienzwith booleans it'll usually "work", but relying on that is bad form.
triplah_w>>> (499+1) is (500)
False
nemesis128err
triplah_wdont use is
nemesis128with == ?
chrisjwohhh
is
IDS ONLY!!
triplah_wyes
nemesis128>>> ('key' in Dict) == Dict.has_key('key') <-- False
marienzerr?
nemesis128sry without parens
marienzthat's bizarre.
oh, without parens?
nemesis128>>> 'key' in Dict == Dict.has_key('key') <-- False
cartesian1984How to save the output of an os.system("ls") as a variable?
marienzhmm, I guess "in" and == have their precedence the wrong way around then.
triplah_wcartesian1984: use subprocess
marienzit's not really a useful thing to run anyway though.
triplah_wcartesian1984: the subprocess module
cartesian1984triplah_w: okay, I'll look into it.
chrisjwgrrrr
deltabcartesian1984: do you really want to run ls, or would os.listdir do?
triplah_wcartesian1984: specifically .call or the .Popen module
and what deltab said :)
chrisjwtotally immaterrial question, but what's the type of evaluation where there are no brackets because all the operators are linear
nemesis128I think it is interpreted like 'key' in (Dict.has_key('key')

Page: 1 8 15 22 29 36 

IrcArchive

NY Lost Funds