Note that hashing in python 2.7 and prior to 3.4 is simply broken and
the randomization does not do nearly enough, see
https://bugs.python.org/issue14621
On Wed, Feb 17, 2016 at 4:45 AM, Shell Xu wrote:
> I thought you are right. Here is the source code in python 2.7.11:
>
> long
> PyObject_Hash(
On Tue, Feb 16, 2016 at 9:00 PM Mike Kaplinskiy
wrote:
> Hey folks,
>
> I hope this is the right list for this sort of thing (python-ideas seemed
> more far-fetched).
>
> For some context: there is currently a issue with pex that causes
> sys.modules lookups to stop working for __main__. In turns
Hey folks,
I hope this is the right list for this sort of thing (python-ideas seemed
more far-fetched).
For some context: there is currently a issue with pex that causes
sys.modules lookups to stop working for __main__. In turns this makes
unittest.run() & pkg_resources.resource_* fail. The root
I thought you are right. Here is the source code in python 2.7.11:
long
PyObject_Hash(PyObject *v)
{
PyTypeObject *tp = v->ob_type;
if (tp->tp_hash != NULL)
return (*tp->tp_hash)(v);
/* To keep to the general practice that inheriting
* solely from object in C code should w
Glenn Linderman writes:
> I think hashes of all types have been randomized, not _just_ the list
> you mentioned.
Yes. There's only one hash function used, which operates on byte
streams IIRC. That function now has a random offset. The details of
hashing each type are in the serializations t
On Tue, Feb 16, 2016 at 11:56:55AM -0800, Glenn Linderman wrote:
> On 2/16/2016 1:48 AM, Christoph Groth wrote:
> >Hello,
> >
> >Recent Python versions randomize the hashes of str, bytes and datetime
> >objects. I suppose that the choice of these three types is the result
> >of a compromise. Ha
On 2/16/2016 1:48 AM, Christoph Groth wrote:
Hello,
Recent Python versions randomize the hashes of str, bytes and datetime
objects. I suppose that the choice of these three types is the result
of a compromise. Has this been discussed somewhere publicly?
Search archives of this list... it w
Hello,
Recent Python versions randomize the hashes of str, bytes and
datetime objects. I suppose that the choice of these three types
is the result of a compromise. Has this been discussed somewhere
publicly?
I'm not a web programmer, but don't web applications also use
dictionaries that