mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
save_bool(): simplified.
This commit is contained in:
parent
cbd0a32d09
commit
22987e3cbd
1 changed files with 1 additions and 4 deletions
|
@ -358,10 +358,7 @@ class Pickler:
|
||||||
dispatch[NoneType] = save_none
|
dispatch[NoneType] = save_none
|
||||||
|
|
||||||
def save_bool(self, object):
|
def save_bool(self, object):
|
||||||
if object:
|
self.write(object and TRUE or FALSE)
|
||||||
self.write(TRUE)
|
|
||||||
else:
|
|
||||||
self.write(FALSE)
|
|
||||||
dispatch[bool] = save_bool
|
dispatch[bool] = save_bool
|
||||||
|
|
||||||
def save_int(self, object):
|
def save_int(self, object):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue