> 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