#python - Fri 16 Mar 2007 between 15:17 and 15:23

NY Lost Funds



insanekaneEnquest: mxDateTime
ZalEnquest datetime.date.today() + datetime.timedelta(days=30)
sjbrowntoma^, do you possibly want obj.__class__.__name__
insanekaneEnquest: also, I remember seeing a module, which allowed you to do that ... i think it was to do with recurrence rules
Enquestdate.today() + 30 days
insanekane, I need very simple... I'm a very beginner at python just simple + 30 days
insanekaneEnquest: google for recur.py ... i think
kbrooksEnquest, uh that isnt allowed.
Zaluh, sure it is
sjbrowntoma^, are you comparing it to a reference to a class, or are you comparing it to a string?
ZalEnquest I just showed you how
kbrooksZal, "a + 30 days" is illegal syntax
EnquestZal ok I overlooked that sorry
Zalkbrooks right. He was ASKING for syntax, not offering it
kbrooksZal, so?
Zalkbrooks so you critiqued it as if he were offering syntax
insanekaneEnquest: http://mail.python.org/pipermail/python-announce-list/1999-August/000163.html
toma^sjbrown: I want to say "if type( object ) == someClass:" . However, even tho "type( object )" returns "<class 'Table.Table'>" the comparison "if type( object ) == Table:" still works
kbrooksyou can't LITERALLY say date.today() + 30 days, and even with days removed, it is confusing. what do you add?
ironfroggytoma^: why on earth would you want to do that??
toma^sjbrown: so it looks like there isn't a real problem :S
kbrookstoma^, yes. it makes sense that it works.
toma^ironfroggy: well, typechecking? So functions get the right kind of input?
EnquestUhm I'm a bit overwelmd
insanekanetoma^: instanceof
TFKyletoma^: you might want to use isinstance instead, it works properly with subclasses
kbrookstoma^, typechecking is silly.
ironfroggytoma^: thats not how you make sure they get the right kind of input. and no, you dont use instanceof either.
insanekaneright ... isinstance
ironfroggyyou just expect they get the right thing. if they dont, they will fail naturally.
ZalEnquest your orginal question ("1 month") is a pretty complex task. Using "30 days" though is easy, as I showed you
ironfroggyduck typing is a very elegant thing.
insanekaneor, you use interfaces and you query for it :P
kbrooksinsanekane, that's awful.
insanekaneor you "adapt" it
ironfroggyfor example, i dont ever check that something is a list, even if i expect it, because then i can use anything that acts enough like a list.
toma^hmm
twbInteresting. Some code was 77 lines in Chicken Scheme, 55 lines in Python 2.5.
insanekanekbrooks: depends on your use case :P
ironfroggytoma^: you dont care what type something is, only that it happens to act as you expect in that function.

Page: 3 10 17 24 31 38 45 52 59 66 

IrcArchive

NY Lost Funds