[2.7] bpo-20047: Make bytearray methods partition() and rpartition() rejecting (GH-4158) by serhiy-storchaka · Pull Request #4163 · python/cpython · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 29 additions & 6 deletions Lib/test/test_bytes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Bytearray methods partition() and rpartition() now accept only bytes-like
objects as separator, as documented. In particular they now raise TypeError
rather of returning a bogus result when an integer is passed as a separator.
27 changes: 24 additions & 3 deletions Objects/bytearrayobject.c
Loading