diff roundup/date.py @ 3349:9c65e32514aa

types module delenda est
author Anthony Baxter <anthonybaxter@users.sourceforge.net>
date Wed, 08 Jun 2005 03:47:09 +0000
parents 4a5893bfd70d
children 9c080e19f307
line wrap: on
line diff
--- a/roundup/date.py	Wed Jun 08 03:41:46 2005 +0000
+++ b/roundup/date.py	Wed Jun 08 03:47:09 2005 +0000
@@ -15,14 +15,13 @@
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 #
-# $Id: date.py,v 1.81 2005-03-03 04:49:16 richard Exp $
+# $Id: date.py,v 1.82 2005-06-08 03:47:09 anthonybaxter Exp $
 
 """Date, time and time interval handling.
 """
 __docformat__ = 'restructuredtext'
 
 import time, re, calendar
-from types import *
 import i18n
 
 try:
@@ -483,9 +482,9 @@
     ):
         """Construct an interval given a specification."""
         self.setTranslator(translator)
-        if type(spec) in (IntType, FloatType, LongType):
+        if isinstance(spec, (int, float, long)):
             self.from_seconds(spec)
-        elif type(spec) in (StringType, UnicodeType):
+        elif isinstance(spec, basestring):
             self.set(spec, allowdate=allowdate, add_granularity=add_granularity)
         elif isinstance(spec, Interval):
             (self.sign, self.year, self.month, self.day, self.hour,

Roundup Issue Tracker: http://roundup-tracker.org/