P
python
Hi-
I'm getting a "DeprecationWarning: integer argument expected, got float"
warning with mx.DateTime and I can't figure out why. Can anyone help me
out?
This code:
import mx.DateTime
class xLabeller:
def __init__(self, firstdate,fmt='%B, %Y'):
self.firstdate = firstdate
self.fmt = fmt
self.mm = mx.DateTime.RelativeDateTime(months=1)
def __call__(self, i):
dt = self.firstdate + self.mm * int(i)
return dt.Format(self.fmt)
nov99 = mx.DateTime.Date(int(1999), int(11))
xl = xLabeller(nov99)
print "xl2:"
print xl(int(3))
Produces this warning:
xl2:
C:\Python23\lib\site-packages\mx\DateTime\DateTime.py:585:
DeprecationWarning: integer argument expected, got float
return DateTime(year, month, 1) + \
February, 2000
What is the story? I've wrapped every number in my program with int(). I
can't figure out what's triggering the warning.
And, even stranger, the whole thing works fine at the python shell:
What am I doing wrong?
Thanks for the help.
I'm getting a "DeprecationWarning: integer argument expected, got float"
warning with mx.DateTime and I can't figure out why. Can anyone help me
out?
This code:
import mx.DateTime
class xLabeller:
def __init__(self, firstdate,fmt='%B, %Y'):
self.firstdate = firstdate
self.fmt = fmt
self.mm = mx.DateTime.RelativeDateTime(months=1)
def __call__(self, i):
dt = self.firstdate + self.mm * int(i)
return dt.Format(self.fmt)
nov99 = mx.DateTime.Date(int(1999), int(11))
xl = xLabeller(nov99)
print "xl2:"
print xl(int(3))
Produces this warning:
xl2:
C:\Python23\lib\site-packages\mx\DateTime\DateTime.py:585:
DeprecationWarning: integer argument expected, got float
return DateTime(year, month, 1) + \
February, 2000
What is the story? I've wrapped every number in my program with int(). I
can't figure out what's triggering the warning.
And, even stranger, the whole thing works fine at the python shell:
What am I doing wrong?
Thanks for the help.