Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 925061a

Browse files
committed
move MAX_ITEMS, MAX_BYTES to session from serialize
1 parent cffab5c commit 925061a

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

IPython/kernel/zmq/serialize.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
can, uncan, can_sequence, uncan_sequence, CannedObject,
1818
istype, sequence_types, PICKLE_PROTOCOL,
1919
)
20+
from .session import MAX_ITEMS, MAX_BYTES
21+
2022

2123
if PY3:
2224
buffer = memoryview
@@ -25,9 +27,6 @@
2527
# Serialization Functions
2628
#-----------------------------------------------------------------------------
2729

28-
# default values for the thresholds:
29-
MAX_ITEMS = 64
30-
MAX_BYTES = 1024
3130

3231
def _extract_buffers(obj, threshold=MAX_BYTES):
3332
"""extract buffers larger than a certain threshold"""

jupyter_client/session.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ def compare_digest(a,b): return a == b
5353
TraitError,
5454
)
5555
from IPython.utils.pickleutil import PICKLE_PROTOCOL
56-
from IPython.kernel.zmq.serialize import MAX_ITEMS, MAX_BYTES
5756
from jupyter_client.adapter import adapt
5857

5958
#-----------------------------------------------------------------------------
@@ -78,6 +77,10 @@ def squash_unicode(obj):
7877
# globals and defaults
7978
#-----------------------------------------------------------------------------
8079

80+
# default values for the thresholds:
81+
MAX_ITEMS = 64
82+
MAX_BYTES = 1024
83+
8184
# ISO8601-ify datetime objects
8285
# allow unicode
8386
# disallow nan, because it's not actually valid JSON

0 commit comments

Comments
 (0)