On Sun, Mar 1, 2009 at 10:45 AM, Hirokazu Yamamoto
wrote:
> I uploaded the patch with choice (a)
> http://bugs.python.org/file13215/py3k_mmap_and_bytes.patch
> If (b) is suitable, I'll rewrite the patch.
> ___
> Python-Dev mailing list
> Python-Dev@pytho
I uploaded the patch with choice (a)
http://bugs.python.org/file13215/py3k_mmap_and_bytes.patch
If (b) is suitable, I'll rewrite the patch.
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
Victor Stinner wrote:
About m.read_byte(), we have two choices:
(a) Py_BuildValue("b", value) => 0
(b) Py_BuildValue("y#", &value, 1) => b"\x00"
About m.write_byte(x), we have also two choices:
(a) PyArg_ParseTuple(args, "b:write_byte", &value): write_byte(0)
(b) PyArg_ParseTuple(args, "y#:
About m.read_byte(), we have two choices:
(a) Py_BuildValue("b", value) => 0
(b) Py_BuildValue("y#", &value, 1) => b"\x00"
About m.write_byte(x), we have also two choices:
(a) PyArg_ParseTuple(args, "b:write_byte", &value): write_byte(0)
(b) PyArg_ParseTuple(args, "y#:write_byte", &value, &len
It certainly seems like mmap should be playing in an all-bytes world
(where only already encoded strings are allowed).
Agreed.
On the specific
question of whether it would be better for read_byte()/write_byte to use
1-length bytes objects or integers, I have no strong opinion (the former
is cl
Hirokazu Yamamoto wrote:
> Hello. I noticed mmap.read_byte returns 1-length unicode on py3k. I felt
> this was strange, so I created issue on bug tracker
> (http://bugs.python.org/issue5391) and Martin proposed this is suitable
> for discussion on python-dev. I'll quote messages on bug tracker here
Hello. I noticed mmap.read_byte returns 1-length unicode on py3k. I felt
this was strange, so I created issue on bug tracker
(http://bugs.python.org/issue5391) and Martin proposed this is suitable
for discussion on python-dev. I'll quote messages on bug tracker here.
I wrote:
On Python3000, m