#python - Mon 16 Apr 2007 between 03:05 and 14:09

NY Lost Funds



joedjtriplah: "1"+1 == 2, IIRC =P
polpakjoedj: no, it doesn't
joedjpolpak: in javascript?
polpakoh
triplahjoedj: i had a dom element, listele1 then did , .replace("listele",""), then added 1 to it and got "11"
joedjah well, it's a lame way to do it anyway
perhaps i'm thinking of s * 1
triplahthat could work
joedjin firefox console "12"+1 gives me "121", "12"*1+1 gives 13
triplahheh cool
jerbearis there a way to do a range with alphabetic characters?
polpak[ chr(x) for x in range(ord('a'), ord('x')) ]
Yhg1sbabo: that doesn't mean you did it right. I notice, for instance, that you are missing the argument-unpacking * in one of your examples.
ironfroggyYhg1s: i did remember about the issues with yield, but i seemed to think `print yield` had no such conflicts.
baboall I want to do is get a date object from a string ... :-(
hmm
Yhg1s: that was it thanks :-)
Yhg1sironfroggy: for any use of yield as an expression, you need the ()'s.
ironfroggy`a = yield` works
TFKylehmm, what's that assign a to?
fluxdude3when using my new class should I set class variables only through functions to validate them?
buffiironfroggy: is that new in 2.5?
fluxdude3eg I have a main() func that uses OptionParser and then tests all args are within bounds etc...
buffisince it wont work for me in 2.4 now when I tried it :)
fluxdude3should that option testing stuff be in my class or stay in the main() func?
ironfroggybuffi: yes
buffiok
ironfroggyTFKyle: to whatever is sent to the generator on the next iteration through its send() method
TFKyleah
fluxdude3if the variable sanitizing logic is in the class itself then it will not allow you to set stupid variables that will break the class derived object, right?
ironfroggyTFKyle: you can also now use the throw method of the generator to cause an exception to suddenly be thrown inside of it
from the point of the last yield
mcbanehow do i compare a tuple, lets say tuple[0] which equals "test" with the string "test"? I have tried it with == but I get: TypeError: unsubscriptable object
Yhg1smcbane: then it wasn't a tuple.
mcbane: t[0] gets you item 0 of tuple t. if it is indeed a tuple.
mcbaneYhg1s: I am quite sure that tuple is a tuple.
Yhg1smcbane: print its repr(). print its type().
mcbaneok, mom
Yhg1sbecause Python is authoratively sure that it is an unsubscriptable object, which means it must not be a tuple (since tuples are subscriptable.)
kosharguing with the computer about what kind of item something is that it is currently running is a losing proposition

Page: 2 9 16 23 30 37 44 51 58 65 72 

IrcArchive

NY Lost Funds