Skip to content

Commit e9153d9

Browse files
committed
Add reference to Django; import to the top
1 parent 522df01 commit e9153d9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pandas/compat/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
from unicodedata import east_asian_width
3737
import struct
3838
import inspect
39+
from collections import namedtuple
3940

4041
PY2 = sys.version_info[0] == 2
4142
PY3 = (sys.version_info[0] >= 3)
@@ -70,8 +71,9 @@ def str_to_bytes(s, encoding=None):
7071
def bytes_to_str(b, encoding=None):
7172
return b.decode(encoding or 'utf-8')
7273

74+
# The signature version below is directly copied from Django,
75+
# https://github.com/django/django/pull/4846
7376
def signature(f):
74-
from collections import namedtuple
7577
sig = inspect.signature(f)
7678
args = [
7779
p.name for p in sig.parameters.values()

0 commit comments

Comments
 (0)