Skip to content

gh-135379: Add back const cast to _PyLong_IsCompact #135706

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 2 commits into from
Jun 19, 2025

Conversation

Fidget-Spinner
Copy link
Member

@Fidget-Spinner Fidget-Spinner commented Jun 19, 2025

@Fidget-Spinner Fidget-Spinner changed the title gh-135668: Add back const cast to _PyLong_IsCompact gh-135379: Add back const cast to _PyLong_IsCompact Jun 19, 2025
@Fidget-Spinner
Copy link
Member Author

!buildbot AMD64 Debian root 3.x

@bedevere-bot
Copy link

The regex 'AMD64 Debian root 3.x' did not match any buildbot builder. Is the requested builder in the list of stable builders?

@Fidget-Spinner
Copy link
Member Author

!buildbot AMD64 Debian root 3

@bedevere-bot
Copy link

The regex 'AMD64 Debian root 3' did not match any buildbot builder. Is the requested builder in the list of stable builders?

@Fidget-Spinner
Copy link
Member Author

!buildbot AMD64 CentOS9

@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @Fidget-Spinner for commit 991c098 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F135706%2Fmerge

The command will test the builders whose names match following regular expression: AMD64 CentOS9

The builders matched are:

  • AMD64 CentOS9 FIPS Only Blake2 Builtin Hash PR
  • AMD64 CentOS9 PR
  • AMD64 CentOS9 LTO PR
  • AMD64 CentOS9 LTO + PGO PR
  • AMD64 CentOS9 FIPS No Builtin Hashes PR
  • AMD64 CentOS9 NoGIL Refleaks PR
  • AMD64 CentOS9 NoGIL PR
  • AMD64 CentOS9 Refleaks PR

@Fidget-Spinner
Copy link
Member Author

!buildbot AMD64 CentOS9 NoGIL PR

@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @Fidget-Spinner for commit 219d9d1 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F135706%2Fmerge

The command will test the builders whose names match following regular expression: AMD64 CentOS9 NoGIL PR

The builders matched are:

  • AMD64 CentOS9 NoGIL PR

@@ -125,9 +125,9 @@ _PyLong_IsCompact(const PyLongObject* op) {
}

static inline int
PyLong_CheckCompact(const PyObject *op)
PyLong_CheckCompact(PyObject *op)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to use PyObject * here because PyLong_CheckExact casts to PyObject * which discards the const qualifier.

@python python deleted a comment from murtazox04 Jun 19, 2025
@encukou encukou merged commit 1b969f6 into python:main Jun 19, 2025
40 checks passed
@Fidget-Spinner Fidget-Spinner deleted the fix-const-cast branch June 19, 2025 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants