This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author belopolsky
Recipients BreamoreBoy, belopolsky, georg.brandl, jimjjewett, ked-tao, loewis, pitrou, tim.peters
Date 2010-07-14.17:41:38
SpamBayes Score 0.013282673
Marked as misclassified No
Message-id <1279129300.27.0.929691532618.issue1646068@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2010-07-14 17:41:40belopolskysetrecipients: + belopolsky, tim.peters, loewis, georg.brandl, jimjjewett, pitrou, ked-tao, BreamoreBoy
2010-07-14 17:41:40belopolskysetmessageid: <1279129300.27.0.929691532618.issue1646068@psf.upfronthosting.co.za>
2010-07-14 17:41:38belopolskylinkissue1646068 messages
2010-07-14 17:41:38belopolskycreate