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.

作者 belopolsky
收信人 BreamoreBoy, belopolsky, georg.brandl, jimjjewett, ked-tao, loewis, pitrou, tim.peters
日期 2010-07-14.17:41:38
SpamBayes Score 0.013282673
Marked as misclassified
Message-id <1279129300.27.0.929691532618.issue1646068@psf.upfronthosting.co.za>
In-reply-to
内容
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.
历史
日期 用户 动作 参数
2010-07-14 17:41:40belopolsky修改recipients: + belopolsky, tim.peters, loewis, georg.brandl, jimjjewett, pitrou, ked-tao, BreamoreBoy
2010-07-14 17:41:40belopolsky修改messageid: <1279129300.27.0.929691532618.issue1646068@psf.upfronthosting.co.za>
2010-07-14 17:41:38belopolsky链接issue1646068 messages
2010-07-14 17:41:38belopolsky创建