Ezio Melotti added the comment:
See #22581.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16518
___
___
Python-bugs-list mailing list
Georg Brandl added the comment:
Please open a new issue for those.
--
nosy: +georg.brandl
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16518
___
Roundup Robot added the comment:
New changeset e7e8a218737a by R David Murray in branch 'default':
#16518: Bring error messages in harmony with docs (bytes-like object)
https://hg.python.org/cpython/rev/e7e8a218737a
--
___
Python tracker
R. David Murray added the comment:
Committed the message changes to 3.5 only, since it will probably cause tests
to fail in various projects, despite messages not being a formal part of the
python API.
Per IRC conversation with Ezio and Antoine, I posted a note to python-dev to
let people
Serhiy Storchaka added the comment:
There are other unfixed messages (may be introduced after 3.3):
b''.join([''])
Traceback (most recent call last):
File stdin, line 1, in module
TypeError: sequence item 0: expected bytes, bytearray, or an object with the
buffer interface, str found
Ezio Melotti added the comment:
Updated patch to include getargs.c too.
--
stage: patch review - commit review
Added file: http://bugs.python.org/file30138/issue16518-4.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16518
Raymond Hettinger added the comment:
At first-reading, it looks like matters were made more confusing with
bytes-like object as a defined term.
--
nosy: +rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16518
Ezio Melotti added the comment:
Can you elaborate?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16518
___
___
Python-bugs-list mailing list
Roundup Robot added the comment:
New changeset 003e4eb92683 by Ezio Melotti in branch '3.3':
#16518: use bytes-like object throughout the docs.
http://hg.python.org/cpython/rev/003e4eb92683
New changeset d4912244cce6 by Ezio Melotti in branch 'default':
#16518: merge with 3.3.
Ezio Melotti added the comment:
The attached patch uses bytes-like objects in the error messages.
--
Added file: http://bugs.python.org/file30124/issue16518-3.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16518
Antoine Pitrou added the comment:
The attached patch uses bytes-like objects in the error messages.
I'm surprised your patch doesn't touch Python/getargs.c.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16518
Ezio Melotti added the comment:
FWIW I was grepping for buffer protocol/interface/api, and then double-checking
for buffer in the resulting files. Python/getargs.c doesn't seem to mention
the buffer protocol/interface/api at all.
--
___
Python
Roundup Robot added the comment:
New changeset d1aa8a9eba44 by Ezio Melotti in branch '2.7':
#16518: fix links in glossary entry.
http://hg.python.org/cpython/rev/d1aa8a9eba44
--
___
Python tracker rep...@bugs.python.org
Ezio Melotti added the comment:
The attached patch replaces things like object that support the buffer
protocol/interface/API with bytes-like objects throughout the docs.
The patch doesn't change error messages/docstrings.
I also noticed that on 2.7[0], the section about the buffer protocol in
Antoine Pitrou added the comment:
I also noticed that on 2.7[0], the section about the buffer protocol
in Doc/c-api/buffer.rst is called Buffers and Memoryview Objects and
it's not as clear as the one on 3.x[1]. Should this section be
backported?
The buffer protocol situation is different
Roundup Robot added the comment:
New changeset 474f28bf67b3 by Ezio Melotti in branch '3.3':
#16518: add bytes-like object to the glossary.
http://hg.python.org/cpython/rev/474f28bf67b3
New changeset 747cede24367 by Ezio Melotti in branch 'default':
#16518: merge with 3.3.
Ezio Melotti added the comment:
Here's a patch that adds bytes-like object to the glossary, links to the
buffer protocol docs[0] and provides bytes and bytearray as examples.
[0]: http://docs.python.org/dev/c-api/buffer.html#buffer-protocol
--
keywords: +patch
stage: needs patch -
Changes by Florent Xicluna florent.xicl...@gmail.com:
--
nosy: +flox
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16518
___
___
Python-bugs-list
Chris Jerdonek added the comment:
After this issue is resolved, the binascii docs can be updated as suggested in
issue 16724.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16518
___
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
stage: - needs patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16518
___
___
Terry J. Reedy added the comment:
I would use the term that is currently used in some error messages.
--
nosy: +terry.reedy
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16518
___
Antoine Pitrou added the comment:
Buffer protocol is the right term. Buffer object doesn't mean anything in
Python 3 and, furthermore, it might be mixed up with the Python 2 `buffer` type.
As for the error messages, they are generally very bad on this topic, so I
would vote to change them :-)
Chris Jerdonek added the comment:
Do we have a recommended (and preferably briefer) way of saying, any object
that supports the buffer protocol?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16518
Chris Jerdonek added the comment:
s/any//
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16518
___
___
Python-bugs-list mailing list
Ezio Melotti added the comment:
Buffer object doesn't mean anything in Python 3 and, furthermore,
it might be mixed up with the Python 2 `buffer` type.
Agreed.
As for the error messages, they are generally very bad on this topic,
so I would vote to change them :-)
I would say that they
Antoine Pitrou added the comment:
Do we have a recommended (and preferably briefer) way of saying, any
object that supports the buffer protocol?
It depends where. There's no recommended way yet, but I would vote for
bytes-like object in error messages that are targetted at the average
Ezio Melotti added the comment:
I would vote for bytes-like object
Sounds like a good compromise between brevity and clarity to me.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16518
Stefan Krah added the comment:
I wouldn't use bytes-like object. One can certainly argue that *memoryview*
should be bytes-like as a matter of preference, but the buffer protocol
specifies strongly (or even statically) typed multi-dimensional arrays.
PEP-3118 Py_buffer structs are essentially
Antoine Pitrou added the comment:
I wouldn't use bytes-like object. One can certainly argue that *memoryview*
should be bytes-like as a matter of preference, but the buffer protocol
specifies strongly (or even statically) typed multi-dimensional arrays.
Ach :-(
PEP-3118 Py_buffer structs
Chris Jerdonek added the comment:
I wouldn't use bytes-like object.
What about buffer-like object?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16518
___
Antoine Pitrou added the comment:
I wouldn't use bytes-like object.
What about buffer-like object?
buffer-like means like a buffer which is wrong on two points:
- buffer is not defined at this point, so the user doesn't understand
what it means
- we are not talking about an object which is
Stefan Krah added the comment:
Antoine Pitrou rep...@bugs.python.org wrote:
PEP-3118 Py_buffer structs are essentially how NumPy works internally.
Well, we should still write a Python documentation, not a NumPy
documentation (on this tracker anyway). Outside of NumPy, there's little
use
Antoine Pitrou added the comment:
Well, we should still write a Python documentation, not a NumPy
documentation (on this tracker anyway). Outside of NumPy, there's little
use for multi-dimensional objects.
Ok, but people should not be surprised if their (Python) array.array() of
double
Stefan Krah added the comment:
Antoine Pitrou rep...@bugs.python.org wrote:
How about object does not provide a byte buffer for error messages
and (byte) buffer provider as a shorthand for any buffer provider
that exposes its memory as a sequence of unsigned bytes in response
to a
Chris Jerdonek added the comment:
That's why I'm proposing bytes-like object.
If it is somehow possible to establish the term as a shorthand for the real
meaning,
This can be established via the glossary. We can still use buffer provider
for the general case, if we find that it is useful
New submission from Chris Jerdonek:
This issue is to add buffer protocol (or perhaps buffer object) to the
glossary. The concept is currently described here:
http://docs.python.org/dev/c-api/buffer.html#buffer-protocol
Éric initially suggested doing this in the comments to issue 13538.
Such
36 matches
Mail list logo