Rename 'bin' arg to 'proto'. Keep the default at 0 lest the tests

change in meaning.
This commit is contained in:
Guido van Rossum 2003-01-28 03:51:53 +00:00
parent 3b769835ca
commit 9d32bb1708

View file

@ -18,9 +18,9 @@ class PicklerTests(AbstractPickleTests):
error = KeyError error = KeyError
def dumps(self, arg, bin=0): def dumps(self, arg, proto=0):
f = StringIO() f = StringIO()
p = pickle.Pickler(f, bin) p = pickle.Pickler(f, proto)
p.dump(arg) p.dump(arg)
f.seek(0) f.seek(0)
return f.read() return f.read()
@ -32,12 +32,12 @@ class PicklerTests(AbstractPickleTests):
class PersPicklerTests(AbstractPersistentPicklerTests): class PersPicklerTests(AbstractPersistentPicklerTests):
def dumps(self, arg, bin=0): def dumps(self, arg, proto=0):
class PersPickler(pickle.Pickler): class PersPickler(pickle.Pickler):
def persistent_id(subself, obj): def persistent_id(subself, obj):
return self.persistent_id(obj) return self.persistent_id(obj)
f = StringIO() f = StringIO()
p = PersPickler(f, bin) p = PersPickler(f, proto)
p.dump(arg) p.dump(arg)
f.seek(0) f.seek(0)
return f.read() return f.read()