PEP 276 -- What else could iter(5) mean?

Quinn Dunkan quinn at pfennig.ugcs.caltech.edu
Sat Mar 9 00:21:36 EST 2002


On 3 Mar 2002 22:11:50 GMT, Bengt Richter <bokr at oz.net> wrote:
>>It should give an error - 5 is not a sequence, so 'i in 5' is nonsense.
>>
>No, it's not nonsense. 'i in 5' is a probability, so
>
>    for i in 5:
>        do_this()
>
>should have an i/5.0 chance of executing do_this().

Reminds me of icon's 'random' operator.

Along with its 500 other operators.



More information about the Python-list mailing list