This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: bytes,join and bytearray.join not in manual; help for bytes.join is wrong.
Type: Stage:
Components: Documentation Versions: Python 3.0, Python 3.1
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: georg.brandl, sjmachin, terry.reedy
Priority: normal Keywords:

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:

    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:

    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''.
msg78081 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) 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. ...
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
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) * (Python committer) Date: 2008-12-27 19:13
Closing as "works for me".
Date User Action Args
2022-04-11 14:56:42adminsetgithub: 48919
2008-12-27 19:13:01georg.brandlsetstatus: open -> closed
resolution: works for me
messages: + msg78383
2008-12-20 04:07:31sjmachinsetmessages: + msg78084
2008-12-20 03:06:26terry.reedysetnosy: + terry.reedy
messages: + msg78081
2008-12-15 08:29:43sjmachincreate