On Wed, May 14, 2008 at 2:39 PM, Nick Coghlan <[EMAIL PROTECTED]> wrote:
> M.-A. Lemburg wrote:
>>
>> On 2008-05-14 18:33, Georg Brandl wrote:
>>>
>>> M.-A. Lemburg schrieb:
>>>>
>>>> Fine, so we need new methods for PyUnicode and PyString objects
>>>> which allow encoding and decoding using the same type (and enforce
>>>> the return types).
>>>>
>>>> Any suggestions ?
>>>>
>>>> How about these:
>>>>
>>>> str.str_encode() -> str
>>>> str.str_decode() -> str
>>>>
>>>> bytes.bytes_encode() -> bytes
>>>> bytes.bytes_decode() -> bytes
>>>
>>> Cool, a naming contest :)
>>>
>>> What about transform/untransform?
>>
>> Not bad :-)
>>
>> Here's a version without underscores:
>>
>> str.encodestr() -> str
>> str.decodestr() -> str
>>
>> bytes.encodebytes() -> bytes
>> bytes.decodebytes() -> bytes
>
> A couple more possibilities (Guido is probably going to have to choose a
> colour for this bikeshed somewhere along the line...):
>
> mystr.recodeto('unicode-escaped')
> mystr.recodefrom('unicode-escaped')
>
> mybytes.recodeto('hex')
> mybytes.recodefrom('hex')

Nah. I'm still in favor of [un]transform. Let's just stick to that.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
_______________________________________________
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

Reply via email to