GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-92800: Fix C++ _Py_CAST with constant types by da-woods · Pull Request #92818 · python/cpython

Conversation

@da-woods

@da-woods da-woods commented May 15, 2022

Copy link
Copy Markdown
Contributor

Thus fixing PyUnicode_READ in C++.
Fixes #92800

I've created a C++ helper struct definition to work out the
type with constant added (it's OK to add const to a constant
type in typedefs in C++).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@da-woods
Fix C++ _Py_CAST with constant types
dd910a7
Thus fixing PyUnicode_READ in C++.
Fixes python#92800

I've created a C++ helper struct definition to work out the
type with constant added (it's OK to add const to a constant
type in typedefs in C++).
@bedevere-bot bedevere-bot added the awaiting review label May 15, 2022
@da-woods

da-woods commented May 15, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

I think this can be skipped in news.

I don't think it's hugely easy to add tests for this specifically - I think this requires Python to be tested with a C++ compiler (which I don't know if it is right now?) I've added a test now

I'm not hugely happy with adding a helper struct definition, but I can't see any other easy way to do this.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

da-woods added 2 commits May 15, 2022 13:11
@da-woods
Add pointer specialization
928ebf5
@da-woods
Added test
9534186
@da-woods da-woods mentioned this pull request May 17, 2022
gh-89653: PEP 670: Fix PyUnicode_READ() cast #92872
Merged
@da-woods

da-woods commented May 17, 2022

Copy link
Copy Markdown
Contributor Author

This was fixed elsewhere

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@da-woods da-woods closed this May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting review

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

PyUnicode_READ() fails to build on C++: _Py_CAST() used with a constant type (const void*)

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@da-woods @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.