Skip to content

bpo-38075: Port _randommodule.c to PEP-384 #15798

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 13, 2019
Merged

Conversation

DinoV
Copy link
Contributor

@DinoV DinoV commented Sep 9, 2019

Summary:

  • 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.

https://bugs.python.org/issue38075

Summary:
- 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.
@DinoV DinoV requested a review from rhettinger as a code owner September 9, 2019 15:58
@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).

Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA (this might be simply due to a missing "GitHub Name" entry in your b.p.o account settings). This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

You can check yourself to see if the CLA has been received.

Thanks again for your contribution, we look forward to reviewing it!

@DinoV DinoV changed the title bpo-38075: Port _randommodule.c to PEP384 bpo-38075: Port _randommodule.c to PEP-384 Sep 9, 2019
@Yhg1s Yhg1s merged commit 04f0bbf into python:master Sep 13, 2019
@DinoV DinoV deleted the pep384/random branch May 31, 2024 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants