Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Eliminate duplicated assignment in _randommodule.c (GH-25904) (GH-25909) | Miss Islington (bot) | 2021-05-05 | 1 | -1/+1 |
| | |||||
* | bpo-40137: Add pycore_moduleobject.h internal header (GH-25507) | Victor Stinner | 2021-04-21 | 1 | -2/+3 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add pycore_moduleobject.h internal header file with static inline functions to access module members: * _PyModule_GetDict() * _PyModule_GetDef() * _PyModule_GetState() These functions don't check at runtime if their argument has a valid type and can be inlined even if Python is not built with LTO. _PyType_GetModuleByDef() uses _PyModule_GetDef(). Replace PyModule_GetState() with _PyModule_GetState() in the extension modules, considered as performance sensitive: * _abc * _functools * _operator * _pickle * _queue * _random * _sre * _struct * _thread * _winapi * array * posix The following extensions are now built with the Py_BUILD_CORE_MODULE macro defined, to be able to use the internal pycore_moduleobject.h header: _abc, array, _operator, _queue, _sre, _struct. | ||||
* | bpo-42008: Fix internal _random.Random() seeding for the one argument case ↵ | AMIR | 2020-12-21 | 1 | -1/+12 |
| | | | | (GH-22668) | ||||
* | bpo-1635741: Port _random to multiphase initialization (GH-23359) | Christian Heimes | 2020-11-19 | 1 | -45/+49 |
| | | | Signed-off-by: Christian Heimes <christian@python.org> | ||||
* | bpo-41052: Fix pickling heap types implemented in C with protocols 0 and 1 ↵ | Serhiy Storchaka | 2020-10-24 | 1 | -17/+0 |
| | | | | (GH-22870) | ||||
* | bpo-41052: Opt out serialization/deserialization for _random.Random (GH-21002) | Dong-hee Na | 2020-06-21 | 1 | -0/+18 |
| | |||||
* | bpo-40867: Remove unused include from Module/_randommodule.c (GH-20635) | Erlend Egeberg Aasland | 2020-06-05 | 1 | -1/+0 |
| | |||||
* | bpo-40286: Remove C implementation of Random.randbytes() (GH-19797) | Victor Stinner | 2020-04-29 | 1 | -45/+0 |
| | | | | | Remove _random.Random.randbytes(): the C implementation of randbytes(). Implement the method in Python to ease subclassing: randbytes() now directly reuses getrandbits(). | ||||
* | bpo-40286: Makes simpler the relation between randbytes() and getrandbits() ↵ | Serhiy Storchaka | 2020-04-17 | 1 | -12/+6 |
| | | | | (GH-19574) | ||||
* | bpo-40282: Allow random.getrandbits(0) (GH-19539) | Antoine Pitrou | 2020-04-17 | 1 | -2/+5 |
| | |||||
* | bpo-40302: Replace PY_INT64_T with int64_t (GH-19573) | Victor Stinner | 2020-04-17 | 1 | -6/+6 |
| | | | | | | | | | * Replace PY_INT64_T with int64_t * Replace PY_UINT32_T with uint32_t * Replace PY_UINT64_T with uint64_t sha3module.c no longer checks if PY_UINT64_T is defined since it's always defined and uint64_t is always available on platforms supported by Python. | ||||
* | bpo-40286: Add randbytes() method to random.Random (GH-19527) | Victor Stinner | 2020-04-17 | 1 | -7/+58 |
| | | | | | | | | | | | | Add random.randbytes() function and random.Random.randbytes() method to generate random bytes. Modify secrets.token_bytes() to use SystemRandom.randbytes() rather than calling directly os.urandom(). Rename also genrand_int32() to genrand_uint32(), since it returns an unsigned 32-bit integer, not a signed integer. The _random module is now built with Py_BUILD_CORE_MODULE defined. | ||||
* | bpo-39968: Convert extension modules' macros of get_module_state() to inline ↵ | Hai Shi | 2020-03-16 | 1 | -7/+13 |
| | | | | functions (GH-19017) | ||||
* | bpo-38075: Fix random_seed(): use PyObject_CallOneArg() (GH-18897) | Victor Stinner | 2020-03-10 | 1 | -4/+1 |
| | | | | | | Fix the random.Random.seed() method when a bool is passed as the seed. PyObject_Vectorcall() was misused: use PyObject_CallOneArg() instead. | ||||
* | bpo-39245: Switch to public API for Vectorcall (GH-18460) | Petr Viktorin | 2020-02-11 | 1 | -1/+1 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bulk of this patch was generated automatically with: for name in \ PyObject_Vectorcall \ Py_TPFLAGS_HAVE_VECTORCALL \ PyObject_VectorcallMethod \ PyVectorcall_Function \ PyObject_CallOneArg \ PyObject_CallMethodNoArgs \ PyObject_CallMethodOneArg \ ; do echo $name git grep -lwz _$name | xargs -0 sed -i "s/\b_$name\b/$name/g" done old=_PyObject_FastCallDict new=PyObject_VectorcallDict git grep -lwz $old | xargs -0 sed -i "s/\b$old\b/$new/g" and then cleaned up: - Revert changes to in docs & news - Revert changes to backcompat defines in headers - Nudge misaligned comments | ||||
* | bpo-38321: Fix compiler warning in _randommodule.c (GH-16512) | Victor Stinner | 2019-10-01 | 1 | -1/+1 |
| | | | | Fix the GCC warning: "initialization discards ‘const’ qualifier from pointer target type". | ||||
* | Fix missing dec ref (#16158) | Dino Viehland | 2019-09-15 | 1 | -0/+1 |
| | |||||
* | bpo-38075: Port _randommodule.c to PEP-384 (GH-15798) | Dino Viehland | 2019-09-13 | 1 | -57/+92 |
| | | | | | | | | | | - Migrate `Random_Type` to `PyType_FromSpec` - To simulate an old use of `PyLong_Type.tp_as_number->nb_absolute`, I added code to the module init function to stash `int.__abs__` for later use. Ideally we'd use `PyType_GetSlot()` instead, but it doesn't currently work for static types in CPython, and implementing it just for this case doesn't seem worth it. - Do exact check for long and dispatch to PyNumber_Absolute, use vector call when not exact. | ||||
* | bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async ↵ | Jeroen Demeyer | 2019-05-31 | 1 | -2/+2 |
| | | | | | | | | | (GH-13464) Automatically replace tp_print -> tp_vectorcall_offset tp_compare -> tp_as_async tp_reserved -> tp_as_async | ||||
* | bpo-37021: Port _randommodule to the argument clinic (GH-13532) | Pablo Galindo | 2019-05-24 | 1 | -26/+83 |
| | |||||
* | closes bpo-35991: Fix a potential double free in Modules/_randommodule.c. ↵ | Zackery Spytz | 2019-02-14 | 1 | -1/+0 |
| | | | | (GH-11849) | ||||
* | bpo-33012: Fix invalid function cast warnings with gcc 8 for METH_NOARGS. ↵ | Siddhesh Poyarekar | 2018-04-29 | 1 | -2/+2 |
| | | | | | | | | | (GH-6030) METH_NOARGS functions need only a single argument but they are cast into a PyCFunction, which takes two arguments. This triggers an invalid function cast warning in gcc8 due to the argument mismatch. Fix this by adding a dummy unused argument. | ||||
* | bpo-31478: Fix an assertion failure in random.seed() in case a seed has a ↵ | Oren Milman | 2017-09-28 | 1 | -2/+5 |
| | | | | bad __abs__() method. (#3596) | ||||
* | bpo-30592: Fixed error messages for some builtins. (#1996) | Serhiy Storchaka | 2017-06-08 | 1 | -1/+1 |
| | | | | | Error messages when pass keyword arguments to some builtins that don't support keyword arguments contained double parenthesis: "()()". The regression was introduced by bpo-30534. | ||||
* | bpo-29960 _random.Random corrupted on exception in setstate(). (#1019) | bladebryan | 2017-04-22 | 1 | -1/+4 |
| | |||||
* | Update URL of Mersenne Twister Home Page (#20) | Hiroki Noda | 2017-02-15 | 1 | -3/+3 |
| | |||||
* | Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE wherever | Serhiy Storchaka | 2017-01-23 | 1 | -2/+1 |
| | | | | possible. Patch is writen with Coccinelle. | ||||
* | fix error check, so that Random.seed actually uses OS randomness (closes #29085) | Benjamin Peterson | 2016-12-29 | 1 | -1/+1 |
| | |||||
* | Issue #27776: include process.h on Windows for getpid() | Victor Stinner | 2016-09-07 | 1 | -0/+3 |
| | |||||
* | os.urandom() now blocks on Linux | Victor Stinner | 2016-09-06 | 1 | -10/+46 |
| | | | | | | | Issue #27776: The os.urandom() function does now block on Linux 3.17 and newer until the system urandom entropy pool is initialized to increase the security. This change is part of the PEP 524. | ||||
* | replace Python aliases for standard integer types with the standard integer ↵ | Benjamin Peterson | 2016-09-06 | 1 | -24/+20 |
| | | | | types (#17884) | ||||
* | Fix typos. Reported by andportnoy on GitHub. | Berker Peksag | 2016-04-29 | 1 | -1/+1 |
| | |||||
* | Issue #25923: Added the const qualifier to static constant arrays. | Serhiy Storchaka | 2015-12-25 | 1 | -1/+1 |
| | |||||
* | Issue #24620: Random.setstate() now validates the value of state last element. | Serhiy Storchaka | 2015-07-24 | 1 | -0/+4 |
|\ | |||||
| * | Issue #24620: Random.setstate() now validates the value of state last element. | Serhiy Storchaka | 2015-07-24 | 1 | -0/+4 |
| | | |||||
* | | Issue #23488: Fix a syntax error on big endian platforms. | Zachary Ware | 2015-05-18 | 1 | -1/+1 |
| | | | | | | | | Hopefully this will allow the PPC64 PowerLinux buildbot to finish a test run. | ||||
* | | Issue #23488: Random generator objects now consume 2x less memory on 64-bit. | Serhiy Storchaka | 2015-05-13 | 1 | -70/+68 |
| | | |||||
* | | Improve struct cache locality by bring commonly accessed fields close together. | Raymond Hettinger | 2015-02-20 | 1 | -1/+1 |
|/ | |||||
* | Fix compiler warning on Windows 64-bit: explicit cast size_t to unsigned long | Victor Stinner | 2013-11-15 | 1 | -2/+2 |
| | |||||
* | Issue #18783: Removed existing mentions of Python long type in docstrings, | Serhiy Storchaka | 2013-08-27 | 1 | -1/+1 |
|\ | | | | | | | error messages and comments. | ||||
| * | Issue #18783: Removed existing mentions of Python long type in docstrings, | Serhiy Storchaka | 2013-08-27 | 1 | -1/+1 |
| | | | | | | | | error messages and comments. | ||||
* | | Issue #18408: random_seed() now raises a MemoryError on memory allocation | Victor Stinner | 2013-07-15 | 1 | -1/+4 |
| | | | | | | | | failure | ||||
* | | Issue #16674: random.getrandbits() is now 20-40% faster for small integers. | Serhiy Storchaka | 2013-01-04 | 1 | -0/+3 |
| | | |||||
* | | Simplify random_seed to use _PyLong_AsByteArray. Closes issue #16496. | Mark Dickinson | 2012-12-21 | 1 | -64/+35 |
|/ | |||||
* | Issue #16096: Fix several occurrences of potential signed integer overflow. ↵ | Mark Dickinson | 2012-10-06 | 1 | -1/+2 |
| | | | | Thanks Serhiy Storchaka. | ||||
* | Issue #14815: Bugfix: the PyLong fed into the seed generator must be unsigned. | Larry Hastings | 2012-06-24 | 1 | -4/+5 |
| | |||||
* | Issue #14815: Use Py_ssize_t instead of long for the object hash, to | Larry Hastings | 2012-06-24 | 1 | -2/+2 |
| | | | | preserve all 64 bits of hash on Win64. | ||||
* | Issue #14909: A number of places were using PyMem_Realloc() apis and | Kristjan Valur Jonsson | 2012-05-31 | 1 | -3/+4 |
| | | | | | PyObject_GC_Resize() with incorrect error handling. In case of errors, the original object would be leaked. This checkin fixes those cases. | ||||
* | tabbing no longer applicable | Benjamin Peterson | 2010-08-24 | 1 | -1/+1 |
| | |||||
* | Recorded merge of revisions 81029 via svnmerge from | Antoine Pitrou | 2010-05-09 | 1 | -357/+357 |
| | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines Untabify C files. Will watch buildbots. ........ |