> > Can you provide examples of where this can't be done using the > > existing approach? > > There is no existing elegant approach except hooking up to the > codecs directly. Adding .decode() is really a matter of adding > symmetry. Yes, but symmetry is good except when it isn't. :-) > Here are some example of how these two codec methods could > be used: > > xmltext = binarydata.encode('base64') > ... > binarydata = xmltext.decode('base64') > > zzz = data.encode('gzip') > ... > data = zzz.decode('gzip') > > jpegimage = gifimage.decode('gif').encode('jpeg') > > mp3audio = wavaudio.decode('wav').encode('mp3') > > etc. How would you do this currently? > Basically all content transfer encodings can take advantage of > these two methods. > > It's not really code bloat, BTW, since the C API is there; > the .decode() method would just expose it. Show me the patch and I'll decide whether it's code bloat. :-) --Guido van Rossum (home page: http://www.python.org/~guido/)
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