why does this hang

John Hunter jdhunter at nitace.bsd.uchicago.edu
Thu Aug 16 18:55:05 EDT 2001


I have a class member function that returns a member of that class,
namely a date class that returns 'tomorrow'

from Trade import MyDate

d = MyDate()
#mdy is month/day/year as a string
print 'today is %s' % d.get_mdy()  
print 'tomorrow is %s' % (d.get_tomorrow().get_mdy())


If I don't put the parens around 'd.get_tomorrow().get_mdy()' the code
hangs (totally frozen, no response to Ctrl-C on a linux box)

Does the % operator bind more tightly than the '.' operator?  Is this
expected?

Thanks,
John Hunter



More information about the Python-list mailing list