summaryrefslogtreecommitdiffstats
path: root/Lib/pickle.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2004-12-05 05:20:42 (GMT)
committerRaymond Hettinger <python@rcn.com>2004-12-05 05:20:42 (GMT)
commit3489cad30af77cb446476cd4c1a908aacc84d9f3 (patch)
tree87a371c09b8a6472e4fb70657e526e16647b31c5 /Lib/pickle.py
parent4ebe364277b62785821003a8161a2081618b23a5 (diff)
downloadcpython-3489cad30af77cb446476cd4c1a908aacc84d9f3.zip
cpython-3489cad30af77cb446476cd4c1a908aacc84d9f3.tar.gz
cpython-3489cad30af77cb446476cd4c1a908aacc84d9f3.tar.bz2
Removed the deprecated bin parameter from the pickle module.
Diffstat (limited to 'Lib/pickle.py')
-rw-r--r--Lib/pickle.py16
1 files changed, 5 insertions, 11 deletions
diff --git a/Lib/pickle.py b/Lib/pickle.py
index 7d6825f..4c91888 100644
--- a/Lib/pickle.py
+++ b/Lib/pickle.py
@@ -171,7 +171,7 @@ del x
class Pickler:
- def __init__(self, file, protocol=None, bin=None):
+ def __init__(self, file, protocol=None):
"""This takes a file-like object for writing a pickle data stream.
The optional protocol argument tells the pickler to use the
@@ -195,12 +195,6 @@ class Pickler:
object, or any other custom object that meets this interface.
"""
- if protocol is not None and bin is not None:
- raise ValueError, "can't specify both 'protocol' and 'bin'"
- if bin is not None:
- warnings.warn("The 'bin' argument to Pickler() is deprecated",
- DeprecationWarning)
- protocol = bin
if protocol is None:
protocol = 0
if protocol < 0:
@@ -1378,12 +1372,12 @@ try:
except ImportError:
from StringIO import StringIO
-def dump(obj, file, protocol=None, bin=None):
- Pickler(file, protocol, bin).dump(obj)
+def dump(obj, file, protocol=None):
+ Pickler(file, protocol).dump(obj)
-def dumps(obj, protocol=None, bin=None):
+def dumps(obj, protocol=None):
file = StringIO()
- Pickler(file, protocol, bin).dump(obj)
+ Pickler(file, protocol).dump(obj)
return file.getvalue()
def load(file):