[issue40325] Random.seed does not affect string hash randomization leading to non-intuitive results

2020-04-19 Thread Yuval S
Change by Yuval S : -- pull_requests: +18932 pull_request: https://github.com/python/cpython/pull/19596 ___ Python tracker <https://bugs.python.org/issue40

[issue40325] Random.seed does not affect string hash randomization leading to non-intuitive results

2020-04-19 Thread Yuval S
Yuval S added the comment: Thank you for the attention and the quick fix. However, the current documentation for "Notes on Reproducibility" should still address this issue of hash randomization. Not only `sample` is affected by this, but any code that combines strings (or bytes o

[issue40325] Random.seed does not affect string hash randomization leading to non-intuitive results

2020-04-18 Thread Yuval S
New submission from Yuval S : The following code gives different results on each run, even though "``random.seed()``" is used: >>> import random >>> random.seed(6) >>> x = set(str(i) for i in range(500)) >>> print(random.sample(x, 1)) presumably

[issue38457] __package__ is None in __init__.py until an import is used

2019-10-13 Thread Yuval S
Yuval S added the comment: * It should be python[23] -m x.test, of course. -- ___ Python tracker <https://bugs.python.org/issue38457> ___ ___ Python-bugs-list m

[issue38457] __package__ is None in __init__.py until an import is used

2019-10-12 Thread Yuval S
New submission from Yuval S : In Python 2.7, the __package__ variable isn't set when __init__.py is run, until an import is done. In Python 3.5, it is set correctly. e.g. # mkdir x && echo "print(__package__)" | tee x/__init__.py x/test.py # python2 x.test None x # python3