Commits

Matthew Schinckel committed a649436 Merge

Merge

Comments (0)

Files changed (1)

timedelta/helpers.py

 import re
 import datetime
 from decimal import Decimal
-from numbers import Number
 
 def nice_repr(timedelta, display="long"):
     """
     floats/Decimals
     """
     assert isinstance(obj1, datetime.timedelta), "First argument must be a timedelta."
-    assert isinstance(obj2, (datetime.timedelta, Number, Decimal)), "Second argument must be a timedelta or number"
+    assert isinstance(obj2, (datetime.timedelta, int, float, Decimal)), "Second argument must be a timedelta or number"
     
     sec1 = obj1.days * 86400 + obj1.seconds
     if isinstance(obj2, datetime.timedelta):
     """
     
     assert isinstance(obj, datetime.timedelta), "First argument must be a timedelta."
-    assert isinstance(val, (Number, Decimal)), "Second argument must be a number."
+    assert isinstance(val, (int, float, Decimal)), "Second argument must be a number."
     
     sec = obj.days * 86400 + obj.seconds
     sec *= val
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.