summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorDino Viehland <dinoviehland@fb.com>2019-09-13 10:12:27 (GMT)
committerT. Wouters <thomas@python.org>2019-09-13 10:12:27 (GMT)
commit04f0bbfbedf8d2bb69b012f853de6648b1a9f27f (patch)
tree2703f0f3a64730d851b9761957dcf995c9615387 /Misc
parent42671aea2db6cbc54369617da0fd3545048e0a45 (diff)
downloadcpython-04f0bbfbedf8d2bb69b012f853de6648b1a9f27f.zip
cpython-04f0bbfbedf8d2bb69b012f853de6648b1a9f27f.tar.gz
cpython-04f0bbfbedf8d2bb69b012f853de6648b1a9f27f.tar.bz2
bpo-38075: Port _randommodule.c to PEP-384 (GH-15798)
- 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.
Diffstat (limited to 'Misc')
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2019-09-09-15-59-50.bpo-38075.N8OZKF.rst1
1 files changed, 1 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Core and Builtins/2019-09-09-15-59-50.bpo-38075.N8OZKF.rst b/Misc/NEWS.d/next/Core and Builtins/2019-09-09-15-59-50.bpo-38075.N8OZKF.rst
new file mode 100644
index 0000000..015951b
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2019-09-09-15-59-50.bpo-38075.N8OZKF.rst
@@ -0,0 +1 @@
+The random module is now PEP-384 compatible \ No newline at end of file