[Python-Dev] Make str/bytes hash algorithm pluggable?

Gregory P. Smith greg at krypto.org
Fri Oct 4 05:37:43 CEST 2013


On Thu, Oct 3, 2013 at 1:06 PM, Victor Stinner <victor.stinner at gmail.com>wrote:

> 2013/10/3 Christian Heimes <christian at python.org>:
> > A hash algorithm can be added and one avaible hash
> > algorithm can be set before Py_Initialize() is called for the first
> > time.
>
> "Py_Initialize" is not the good guard. Try for example "python3 -X
> faulthandler": PyObject_Hash() is called before Py_Initialize() to add
> "faulthandler" key into sys._xoptions dictionary.
>
> Today many Python internal functions are used before Python is
> initialized... See the PEP 432 which proposes to improve the
> situation:
> http://www.python.org/dev/peps/pep-0432/


then I withdraw my desire for setting it before that.  compile time is
fine.  but how would you make that usefully easier than the existing method
of replacing the two functions in our bytes and str implementations?

if you want a compile time flag, perhaps just call it --enable-sip-hash and
get it over with since that's what we really want. ;)

-gps


>
>
> Victor
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
> https://mail.python.org/mailman/options/python-dev/greg%40krypto.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20131003/2c24a088/attachment.html>


More information about the Python-Dev mailing list