Skip to content

Commit 98c8fdd

Browse files
committed
Add an isint() function for consistency with isbytes() and istext()
1 parent 8cfc1a7 commit 98c8fdd

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

future/utils/__init__.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868

6969
import types
7070
import sys
71+
import numbers
7172

7273
PY3 = sys.version_info[0] == 3
7374
PY2 = sys.version_info[0] == 2
@@ -384,11 +385,12 @@ def isbytes(obj):
384385
return isinstance(obj, type(b''))
385386

386387

387-
# def isint(obj):
388-
# """
389-
# Don't define this. Use this idiom instead:
390-
# isinstance(obj, numbers.Integral)
391-
# """
388+
def isint(obj):
389+
"""
390+
Instead of using this function, you can use the following idiom:
391+
isinstance(obj, numbers.Integral)
392+
"""
393+
return isinstance(obj, numbers.Integral)
392394

393395

394396
def native(obj):

0 commit comments

Comments
 (0)