Are there any codecs that can take parameters at initialization time? If not, how about supporting them? Here's a motivating example: import codecs f = codecs.open('output', 'wb', encoding='DES', # arguments to open() key = '...', mode = DES.ECB) f.write('This will be encrypted\n') f.close() For this to work, you'd need a few changes to codecs.py. Off the top of my head, I think StreamReader, StreamWriter, and StreamReaderWriter all need to grow **kwargs arguments for any additional arguments, as do codecs.open() and codecs.lookup(). Then someone could write a DES StreamReader/Streamwriter that took a key and feedback mode at creation time. (codecs.Codec instances are supposed to be stateless, right?) --amk
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