Skip to content

Commit

Permalink
PEP 574: fix error in code sample (python#662)
Browse files Browse the repository at this point in the history
  • Loading branch information
pitrou authored May 22, 2018
1 parent 6d81538 commit bad793c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pep-0574.rst
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ to be returned from ``__reduce__`` implementations::
class bytearray:

def __reduce_ex__(self, protocol):
if protocol == 5:
return type(self), PickleBuffer(self), None
if protocol >= 5:
return type(self), (PickleBuffer(self),), None
# Legacy code for earlier protocols omitted

``PickleBuffer`` is a simple wrapper that doesn't have all the memoryview
Expand Down

0 comments on commit bad793c

Please sign in to comment.