[Python-Dev] Reintroduce or drop completly hex, bz2, rot13, ... codecs

Terry Reedy tjreedy at udel.edu
Wed Jun 9 21:39:04 CEST 2010


On 6/9/2010 7:45 AM, M.-A. Lemburg wrote:
> Nick Coghlan wrote:
>> On 09/06/10 18:41, M.-A. Lemburg wrote:
>>> The methods to be used will be .transform() for the encode direction
>>> and .untransform() for the decode direction.
>>
>> +1, although adding this for 3.2 would need an exception to the
>> moratorium approved (since it is adding new methods for builtin types).

+1 also. This is neither new syntax, nor, really a new feature.
>
> Good point.
>
> We already discussed these methods in 2008 and Guido
> approved them back then, so perhaps that's a good argument
> for an exception.
>
>> Adding the same-type codecs back even without the helper methods should
>> be fine though (less useful without the helper methods, obviously, but
>> still valid).
>
> Agreed.
>
> The new methods would make it easier to port to Python3, though,
> since e.g. data.encode('hex') is easier to convert to
> data.transform('hex').

That would definitely be a point in favor of getting this in 3.2, with 
appropriate additions to 2to3.





More information about the Python-Dev mailing list