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/2001-June/015354.html below:

[Python-Dev] Adding .decode() method to Unicode

[Python-Dev] Adding .decode() method to UnicodeMartin v. Loewis martin@loewis.home.cs.tu-berlin.de
Tue, 12 Jun 2001 00:00:54 +0200
> I would like to add a .decode() method to Unicode objects and also
> enable the builtin unicode() to accept Unicode object as input.

-1. What is this good for?

> While this may seem useless for the currently available encodings,
> it does have some use for codecs which recode Unicode to Unicode,
> e.g. codecs which do XML escaping or Unicode compression.

I still can see the value. If you think the codec API is good for such
transformation, why not use it? I.e.

enc,dec,_,_ = codecs.lookup("compress-form-foo")
s = dec(s)

Furthermore, this seems like a form of hypergeneralization. If you
have this, why not also add

s = s.decode("capitalize") # instead of s.capitalize()
i = s.decode("int")        # instead of int(s)

> Any objections ?

Yes, I think this should not be added.

Regards,
Martin



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