Peter Otten wrote:
> The use of {...} makes this a set literal, and the order of the items in a
> set is undefined. To prevent a class of attacks on web applications it may
> even change between invocations:
Sorry, I forgot to include the source of setdemo.py. It contains just one
line:
print {'/', 'index'}
> $ for i in {1..10}; do echo -n "PYTHONHASHSEED=$i --> "; PYTHONHASHSEED=$i
> python setdemo.py; done
> PYTHONHASHSEED=1 --> set(['index', '/'])
> PYTHONHASHSEED=2 --> set(['/', 'index'])
> PYTHONHASHSEED=3 --> set(['index', '/'])
> PYTHONHASHSEED=4 --> set(['index', '/'])
> PYTHONHASHSEED=5 --> set(['/', 'index'])
> PYTHONHASHSEED=6 --> set(['/', 'index'])
> PYTHONHASHSEED=7 --> set(['index', '/'])
> PYTHONHASHSEED=8 --> set(['/', 'index'])
> PYTHONHASHSEED=9 --> set(['index', '/'])
> PYTHONHASHSEED=10 --> set(['index', '/'])
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor