On 2008-05-09 12:54, M.-A. Lemburg wrote:
On 2008-05-08 22:55, Terry Reedy wrote:
Functions that map unicode->unicode or bytes->bytes could be called
transcoders. Each type could be given a .transcode method to go along
with but contrast with .encode or .decode.
Are you suggesting to have two separate methods which then
allow same-type-conversions ? One for encoding to the same
type and one for decoding ?
Fine with me.
They do have to map naturally to the codec method encode and
decode, though, so a single method won't do, unless maybe
you add a parameter to define the direction of the coding
process.
In summary, I'd just like to see the following happen:
* revert the type restrictions on the PyCodec_* API
* enforce the restrictions on the .encode() and .decode()
methods of PyUnicode and PyString objects (str and bytes)
FYI: The above two bullets have now been implemented as r63986.
* add a way to PyUnicode and PyString objects (str and bytes)
to allow same type encoding and decoding
This is still pending, ie. methods .transform() and .untransform()
still need to be added to bytes/bytearray/str.
--
Marc-Andre Lemburg
eGenix.com
Professional Python Services directly from the Source (#1, Jun 06 2008)
>>> Python/Zope Consulting and Support ... http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/
________________________________________________________________________
2008-07-07: EuroPython 2008, Vilnius, Lithuania 30 days to go
:::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! ::::
eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
Registered at Amtsgericht Duesseldorf: HRB 46611
_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe:
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com