Re: [Python-Dev] What type of object mmap.read_byte should return on py3k?

2009-03-05 Thread Josiah Carlson
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

Re: [Python-Dev] What type of object mmap.read_byte should return on py3k?

2009-03-01 Thread Hirokazu Yamamoto
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:

Re: [Python-Dev] What type of object mmap.read_byte should return on py3k?

2009-02-28 Thread Hirokazu Yamamoto
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#:

Re: [Python-Dev] What type of object mmap.read_byte should return on py3k?

2009-02-28 Thread Victor Stinner
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

Re: [Python-Dev] What type of object mmap.read_byte should return on py3k?

2009-02-28 Thread Hirokazu Yamamoto
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

Re: [Python-Dev] What type of object mmap.read_byte should return on py3k?

2009-02-28 Thread Nick Coghlan
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

[Python-Dev] What type of object mmap.read_byte should return on py3k?

2009-02-28 Thread Hirokazu Yamamoto
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