Skip to content

Commit

Permalink
type check with Integral not int (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmckerns authored Sep 9, 2024
1 parent 702bd8d commit 259ab0a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions klepto/_inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,9 +421,10 @@ def _keygen(func, ignored, *args, **kwds):
user_kwds = kwds.copy()

# decompose the list of things to ignore to names and indicies
if isinstance(ignored, (str,int)): ignored = [ignored]
index_to_ignore = set(i for i in ignored if isinstance(i,int))
names_to_ignore = set(i for i in ignored if isinstance(i,str))
from numbers import Integral
if isinstance(ignored, (str, Integral)): ignored = [ignored]
index_to_ignore = set(i for i in ignored if isinstance(i, Integral))
names_to_ignore = set(i for i in ignored if isinstance(i, str))

# if ignore self, remove self instead of NULL it
if inspect.isfunction(func):
Expand Down
4 changes: 2 additions & 2 deletions klepto/keymaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ def __init__(self, typed=False, flat=True, sentinel=NOSENTINEL, **kwds):

# some rare kwds that allow keymap customization
try:
self._fasttypes = (int,str,bytes,frozenset,type(None))
self._fasttypes = (int,str,bytes,frozenset,type(None)) # int64?
except NameError:
self._fasttypes = (int,str,frozenset,type(None))
self._fasttypes = (int,str,frozenset,type(None)) # int64?
self._fasttypes = kwds.pop('fasttypes', set(self._fasttypes))
self._sorted = kwds.pop('sorted', sorted)
self._tuple = kwds.pop('tuple', tuple)
Expand Down

0 comments on commit 259ab0a

Please sign in to comment.