Re: [Python-Dev] [Python-checkins] r60283 - in python/trunk: Include/longintrepr.h Include/longobject.h Include/unicodeobject.h Misc/NEWS Modules/_fileio.c Objects/longobject.c Objects/unicodeobject.c

2008-01-26 Thread Raymond Hettinger
[christian.heimes]
 Backport of several functions from Python 3.0 to 2.6 including 
 PyUnicode_FromString, PyUnicode_Format and PyLong_From/AsSsize_t. 
 The functions are partly required for the backport of the bytearray type and 
 _fileio module. They should also make it easier to 
 port C to 3.0.


Are you planning to backport bytearrays?  I thought we had clearly decided to 
*not* backport any of the text/bytes model so that the 
Py2.6 string/unicode model remained pure.

Guido proposed a couple of harmless aliases for annotation purposes (to help 
the 2-to-3 tool do the right thing) and that was it. 
Your reply was:

Ah, you like to keep it simple. The aliases are easily to implement.
Give me twenty minutes to implement it and write some unit tests.

How did we get from two simple aliases to plans for backporting major chucks of 
the new model?  I'm not seeing any limits on 
Py3.0--Py2.6 contamination.


Raymond

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] r60283 - in python/trunk: Include/longintrepr.h Include/longobject.h Include/unicodeobject.h Misc/NEWS Modules/_fileio.c Objects/longobject.c Objects/unicodeobject.c

2008-01-26 Thread Christian Heimes
Raymond Hettinger wrote:
 Are you planning to backport bytearrays?  I thought we had clearly decided to 
 *not* backport any of the text/bytes model so that the 
 Py2.6 string/unicode model remained pure.

The idea raised when I was working on a backport of the io module. The
io module requires a mutable byte type. Guido answered a question in my
issue http://bugs.python.org/issue1919

Backporting bytearray should be relatively clean since it's a brand new
type right?

My initial question was:

I'm not sure how to proceed with the missing bytearray type:

 * backport bytearray and the new buffer interface from 3.0
 * write a replacement for 2.6
 * replace the bytearray code with new code

bytearray is a new type that has no equivalent in Python 2.6. Python
3.0's byte type is basically a modified string type. I don't see a
problem with bytearray, do you?

Christian
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] r60283 - in python/trunk: Include/longintrepr.h Include/longobject.h Include/unicodeobject.h Misc/NEWS Modules/_fileio.c Objects/longobject.c Objects/unicodeobject.c

2008-01-26 Thread Guido van Rossum
On Jan 26, 2008 1:16 AM, Raymond Hettinger [EMAIL PROTECTED] wrote:
 Are you planning to backport bytearrays?
 I thought we had clearly decided to *not* backport any of the text/bytes 
 model so that the
 Py2.6 string/unicode model remained pure.

'bytearray' is a separate issue. It's a brand new type: a *mutable*
byte array. Its status as a built-in and completely different API
makes it much more convenient than using the old array module.
Introducing bytearray is not going to disturb the balance between
str/bytes/unicode.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] r60283 - in python/trunk: Include/longintrepr.h Include/longobject.h Include/unicodeobject.h Misc/NEWS Modules/_fileio.c Objects/longobject.c Objects/unicodeobject.c

2008-01-26 Thread Raymond Hettinger
 'bytearray' is a separate issue. It's a brand new type: a *mutable*
 byte array. Its status as a built-in and completely different API
 makes it much more convenient than using the old array module.

That's reasonable.


Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com