A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2013-November/130218.html below:

[Python-Dev] Add transform() and untranform() methods

[Python-Dev] Add transform() and untranform() methods [Python-Dev] Add transform() and untranform() methodsAntoine Pitrou solipsis at pitrou.net
Fri Nov 15 11:33:47 CET 2013
On Fri, 15 Nov 2013 21:28:35 +1100
Steven D'Aprano <steve at pearwood.info> wrote:
> 
> One benefit is:
> 
> import codecs
> codec = get_name_of_compression_codec()
> result = codecs.encode(data, codec)

That's a good point.

> If encoding/decoding is intended to be completely generic (even if 99% 
> of the uses will be with strings and bytes), is there any reason to 
> prefer built-in functions rather than methods on object?

Practicality beats purity. Personally, I've never used codecs on
anything else than str and bytes objects.

Regards

Antoine.


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4