Skip to content

Commit

Permalink
implement ByteArray.join()
Browse files Browse the repository at this point in the history
  • Loading branch information
sziraqui committed Mar 9, 2018
1 parent 11262a0 commit a542b37
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions python/common/org/python/types/ByteArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -808,10 +808,13 @@ public org.python.Object isupper() {
}

@org.python.Method(
__doc__ = "B.join(iterable_of_bytes) -> bytearray\n\nConcatenate any number of bytes/bytearray objects, with B\nin between each pair, and return the result as a new bytearray."
__doc__ = "B.join(iterable_of_bytes) -> bytearray\n\nConcatenate any number of bytes/bytearray objects, with B\nin between each pair, and return the result as a new bytearray.",
args = {"iterable"}
)
public org.python.Object join(java.util.List<org.python.Object> args, java.util.Map<java.lang.String, org.python.Object> kwargs, java.util.List<org.python.Object> default_args, java.util.Map<java.lang.String, org.python.Object> default_kwargs) {
throw new org.python.exceptions.NotImplementedError("bytearray.join has not been implemented.");
public org.python.Object join(org.python.Object iterable) {
org.python.types.Bytes temp = new org.python.types.Bytes(this.value);
org.python.types.Bytes res = (org.python.types.Bytes) temp.join(iterable);
return new ByteArray(res.value);
}

@org.python.Method(
Expand Down

0 comments on commit a542b37

Please sign in to comment.