On Feb 17, 2006, at 4:20 PM, Martin v. Löwis wrote:

> Ian Bicking wrote:
>> Maybe it isn't worse, but the real alternative is:
>>
>>   import zlib
>>   import base64
>>
>>   base64.b64encode(zlib.compress(s))
>>
>> Encodings cover up eclectic interfaces, where those interfaces fit a
>> basic pattern -- data in, data out.
>
> So should I write
>
> 3.1415.encode("sin")
>
> or would that be
>
> 3.1415.decode("sin")
>
> What about
>
> "http://www.python.org".decode("URL")
>
> It's "data in, data out", after all. Who needs functions?

Well, 3.1415.decode("sin") is of course NaN, because 3.1415.encode 
("sinh") is not defined for numbers outside of [-1, 1] :)

-bob

_______________________________________________
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

Reply via email to