[issue17904] bytes should be listed as built-in function for 2.7
New submission from Florent Xicluna:
Looking into the summary table, there's no information about the `bytes` built-in alias for `str`:
http://docs.python.org/2/library/functions.html
IMHO it should appear in this table (as str, unicode, bytearray) with the appropriate `.. versionadded:`.
----------
assignee: docs@python
components: Documentation
messages: 188349
nosy: docs@python, flox
priority: normal
severity: normal
status: open
title: bytes should be listed as built-in function for 2.7
type: behavior
versions: Python 2.7
_______________________________________
Python tracker
Changes by Antoine Pitrou
Ezio Melotti added the comment:
Here's a patch. Do you think it should be added under the string signature too? It will make linking easier, but it might be more confusing for users.
----------
keywords: +patch
nosy: +chris.jerdonek, ezio.melotti
stage: needs patch -> patch review
type: behavior -> enhancement
Added file: http://bugs.python.org/file30201/issue17904.diff
_______________________________________
Python tracker
Andy Maier added the comment:
Ezio, what do you mean with "string signature"?
For me, the patch looks fine as it is.
----------
nosy: +andymaier
_______________________________________
Python tracker
Ezio Melotti added the comment:
I mean here: https://docs.python.org/2/library/functions.html#str
----------
_______________________________________
Python tracker
Andy Maier added the comment:
Your patch right now generates the line:
New in version 2.6: bytes() has been added as an alias for str()
at the end of the paragraph for str().
To me, that is sufficient for the description of str().
If anything, we could add a separate paragraph for bytes(), after the paragraph for bytearray(), e.g. like this:
----------------------------------
.. function:: bytes()
Alias for :func:`str`.
.. versionadded:: 2.6
----------------------------------
If that is what you had in mind, I think it is a good idea to add it.
Andy
----------
_______________________________________
Python tracker
Zachary Ware
participants (5)
-
Andy Maier
-
Antoine Pitrou
-
Ezio Melotti
-
Florent Xicluna
-
Zachary Ware