Antoine Pitrou <pit...@free.fr> added the comment:

Mark:
> Just out of interest, why?  The cast is unnecessary:  there's no ambiguity 
> or undefinedness (the int -1 gets promoted to unsigned long, with 
> wraparound semantics), and neither gcc nor MSVC complains.

Well, I had memories of a weird signed/unsigned problem (issue4935) and
I wasn't sure whether it could raise its head in the present case or
not.

Raymond:
> The latter doesn't
> require any special-casing for various pointer sizes.

The special casing is just there so as to make all pointer bits
participate in the final hash (which is what the original implementation
does). Otherwise we could just unconditionally cast to unsigned long.

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue5186>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to