Issue 4669: bytes,join and bytearray.join not in manual; help for bytes.join is wrong. (original) (raw)
Issue4669
Created on 2008-12-15 08:29 by sjmachin, last changed 2022-04-11 14:56 by admin. This issue is now closed.
Messages (4) | ||
---|---|---|
msg77849 - (view) | Author: John Machin (sjmachin) | Date: 2008-12-15 08:29 |
These methods are parallel to str.join, seem to work as expected, and have "help" entries. However there is nothing in the Library Reference Manual about them. >>> help(bytearray.join) Help on method_descriptor: join(...) B.join(iterable_of_bytes) -> bytearray Concatenate any number of bytes/bytearray objects, with B in between each pair, and return the result as a new bytearray. ### OK but could use an example. >>> help(bytes.join) Help on method_descriptor: join(...) B.join(iterable_of_bytes) -> bytes Concatenate any number of bytes objects, with B in between each pair. ### Above sentence should read "Concatenate any number of bytes/bytearray objects, with B in between each pair, and return the result as a new bytes object." Example: b'.'.join([b'ab', b'pq', b'rs']) -> b'ab.pq.rs'. | ||
msg78081 - (view) | Author: Terry J. Reedy (terry.reedy) * ![]() |
Date: 2008-12-20 03:06 |
I am puzzled as to what you think is missing in the manual. "Bytes and Byte Array Methods Bytes and bytearray objects, being “strings of bytes”, have all methods found on strings, with the exception of encode(), format() and isidentifier(), which do not make sense with these types. ... Note The methods on bytes and bytearray objects don’t accept strings as their arguments, just as the methods on strings don’t accept bytes as their arguments. For example, " I believe you are right that bytes => bytes/bytearray in the second help entry. | ||
msg78084 - (view) | Author: John Machin (sjmachin) | Date: 2008-12-20 04:07 |
Terry, you are right. I missed that. My report was based on looking via the index and finding only "(str method)", no "(byte[sarray] method)". | ||
msg78383 - (view) | Author: Georg Brandl (georg.brandl) * ![]() |
Date: 2008-12-27 19:13 |
Closing as "works for me". |
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-04-11 14:56:42 | admin | set | github: 48919 |
2008-12-27 19:13:01 | georg.brandl | set | status: open -> closedresolution: works for memessages: + |
2008-12-20 04:07:31 | sjmachin | set | messages: + |
2008-12-20 03:06:26 | terry.reedy | set | nosy: + terry.reedymessages: + |
2008-12-15 08:29:43 | sjmachin | create |