Skip to content

Commit 0555e00

Browse files
author
Anthony Baxter
committed
types module delenda est
1 parent 221d099 commit 0555e00

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

roundup/date.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,13 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: date.py,v 1.81 2005-03-03 04:49:16 richard Exp $
18+
# $Id: date.py,v 1.82 2005-06-08 03:47:09 anthonybaxter Exp $
1919

2020
"""Date, time and time interval handling.
2121
"""
2222
__docformat__ = 'restructuredtext'
2323

2424
import time, re, calendar
25-
from types import *
2625
import i18n
2726

2827
try:
@@ -483,9 +482,9 @@ def __init__(self, spec, sign=1, allowdate=1, add_granularity=0,
483482
):
484483
"""Construct an interval given a specification."""
485484
self.setTranslator(translator)
486-
if type(spec) in (IntType, FloatType, LongType):
485+
if isinstance(spec, (int, float, long)):
487486
self.from_seconds(spec)
488-
elif type(spec) in (StringType, UnicodeType):
487+
elif isinstance(spec, basestring):
489488
self.set(spec, allowdate=allowdate, add_granularity=add_granularity)
490489
elif isinstance(spec, Interval):
491490
(self.sign, self.year, self.month, self.day, self.hour,

0 commit comments

Comments
 (0)