##// END OF EJS Templates
move MAX_ITEMS, MAX_BYTES to session from serialize
Min RK -
Show More
@@ -17,6 +17,8 b' from IPython.utils.pickleutil import ('
17 can, uncan, can_sequence, uncan_sequence, CannedObject,
17 can, uncan, can_sequence, uncan_sequence, CannedObject,
18 istype, sequence_types, PICKLE_PROTOCOL,
18 istype, sequence_types, PICKLE_PROTOCOL,
19 )
19 )
20 from .session import MAX_ITEMS, MAX_BYTES
21
20
22
21 if PY3:
23 if PY3:
22 buffer = memoryview
24 buffer = memoryview
@@ -25,9 +27,6 b' if PY3:'
25 # Serialization Functions
27 # Serialization Functions
26 #-----------------------------------------------------------------------------
28 #-----------------------------------------------------------------------------
27
29
28 # default values for the thresholds:
29 MAX_ITEMS = 64
30 MAX_BYTES = 1024
31
30
32 def _extract_buffers(obj, threshold=MAX_BYTES):
31 def _extract_buffers(obj, threshold=MAX_BYTES):
33 """extract buffers larger than a certain threshold"""
32 """extract buffers larger than a certain threshold"""
@@ -53,7 +53,6 b' from IPython.utils.traitlets import (CBytes, Unicode, Bool, Any, Instance, Set,'
53 TraitError,
53 TraitError,
54 )
54 )
55 from IPython.utils.pickleutil import PICKLE_PROTOCOL
55 from IPython.utils.pickleutil import PICKLE_PROTOCOL
56 from IPython.kernel.zmq.serialize import MAX_ITEMS, MAX_BYTES
57 from jupyter_client.adapter import adapt
56 from jupyter_client.adapter import adapt
58
57
59 #-----------------------------------------------------------------------------
58 #-----------------------------------------------------------------------------
@@ -78,6 +77,10 b' def squash_unicode(obj):'
78 # globals and defaults
77 # globals and defaults
79 #-----------------------------------------------------------------------------
78 #-----------------------------------------------------------------------------
80
79
80 # default values for the thresholds:
81 MAX_ITEMS = 64
82 MAX_BYTES = 1024
83
81 # ISO8601-ify datetime objects
84 # ISO8601-ify datetime objects
82 # allow unicode
85 # allow unicode
83 # disallow nan, because it's not actually valid JSON
86 # disallow nan, because it's not actually valid JSON
General Comments 0
You need to be logged in to leave comments. Login now