Matthew Barnett pyt...@mrabarnett.plus.com added the comment:
The problem with the shorthand form is that the generators use the
values that are bound to 'a' and 'p' when they are iterated, not when
they are created. You can test this by inserting:
a = X
just before the assert: you'll get
David W. Lambert b49p23t...@stny.rr.com added the comment:
Thank you!
A prime sieve variant is a better way to generate the generalized
Hamming numbers I'm after, at least if the maximum is known ahead of
time.
Dave Lambert
--
___
Python tracker
Changes by Brett Cannon br...@python.org:
--
resolution: - invalid
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7439
___
New submission from David W. Lambert b49p23t...@stny.rr.com:
Raymond Hettinger posted clever Hamming number generator,
http://code.activestate.com/recipes/576961/
which I tried to modify. The function gives incorrect output when
called as hamming_numbers(shorthand = True). It seemed reasonable