-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow registration to the codecs module #13
Comments
sure, I never used the codecs module much but that sounds like a reasonable feature. A PR adding this is most welcome :) |
Not sure I like the idea of using As a developer, I don't really want to pull in a dependency that covers so many use-cases. I don't care about all the codecs supported by I prefer a well focused library that will only update when something in the base58 implementation needs fixing. Additionally, base58 is a simple algorithm and once the library stabilises, it's unlikely to need new updates. So I opt against integrating this into But having it integrated with the builtin |
Pondering this some again I would advice against using this with the codecs module. base58 is not a general purpose encoding of text or binary like utf16/zlib/base64 etc. Trying to encoding anything but small amounts of data is not a good idea as it relies on repeatedly doing divmod of the entire data represented as a single integer. |
In any case, the registration would have to be done manually at some point by the users of this library. I did a library a while back for This way, anyone who uses this I am (currently at least) not aware if Python has a machinery that allows the execution of code just by installing a library. If there is, I'd love to learn about it. I'd wager that something like that could be abused by nefarious users, especially in combination with typosquatting. Long story short: Offering the possibility to register with the
That But in the end it's only really providing a tiny bit of syntactic sugar. And for those who don't want this, they can simply no call the |
It would be nice to allow this module to register its functions to the codecs module for easier integration.
https://docs.python.org/2.7/library/codecs.html#codecs.register
https://docs.python.org/3.6/library/codecs.html#codecs.register
The text was updated successfully, but these errors were encountered: