Alexander Belopolsky <belopol...@users.sourceforge.net> added the comment:

On the second thought, this comment:

-       /* Cached hash code of me_key.  Note that hash codes are C longs.
-        * We have to use Py_ssize_t instead because dict_popitem() abuses
-        * me_hash to hold a search finger.
-        */

suggests that a union may be appropriate here.  I am not sure of the standards 
standing of anonymous unions, but if we could do

union {
  Py_ssize_t me_finger;
  long me_hash;
};

it would cleanly solve the problem.  If anonymous unions are not available, a 
regular union could also do the trick:

union {
  Py_ssize_t finger;
  long hash;
} me;

and use me.finger where me is used as search finger and me.hash where it stores 
hash.  Less clever naming scheme would be welcome, though.

----------

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

Reply via email to