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 — bpo-45476: Convert PyFloat_AS_DOUBLE() to static inline by vstinner · Pull Request #28961 · python/cpython

Conversation

@vstinner

@vstinner vstinner commented Oct 14, 2021 •
edited by bedevere-bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Convert the following macros to static inline functions to disallow
using them as l-value:

  • PyByteArray_AS_STRING()
  • PyBytes_AS_STRING()
  • PyFloat_AS_DOUBLE()

PyUnicode_AS_UNICODE() becomes an alias to PyUnicode_AsUnicode().

https://bugs.python.org/issue45476

Sorry, something went wrong.

Uh oh!

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

All reactions
@bedevere-bot bedevere-bot added the awaiting core review label Oct 14, 2021
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Oct 14, 2021
@vstinner
bpo-45476: Convert PyFloat_AS_DOUBLE() to static inline
766c72a
Convert the following macros to static inline functions to disallow
using them as l-value:

* PyByteArray_AS_STRING()
* PyBytes_AS_STRING()
* PyFloat_AS_DOUBLE()

PyUnicode_AS_UNICODE() becomes an alias to PyUnicode_AsUnicode().
@vstinner
vstinner marked this pull request as draft October 15, 2021 00:08
@vstinner

vstinner commented Oct 15, 2021

Copy link
Copy Markdown
Member Author

I convert this PR to a draft since there is disagreement: https://bugs.python.org/issue45476#msg403956

All reactions

Sorry, something went wrong.

Uh oh!

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

@github-actions

github-actions Bot commented Nov 15, 2021

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

All reactions

Sorry, something went wrong.

Uh oh!

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

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Nov 15, 2021
@vstinner

vstinner commented Nov 16, 2021

Copy link
Copy Markdown
Member Author

I wrote PEP 670 https://www.python.org/dev/peps/pep-0670/ to decide what's the best approach to fix https://bugs.python.org/issue45476

All reactions

Sorry, something went wrong.

Uh oh!

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

@github-actions github-actions Bot removed the stale Stale PR or inactive for long period of time. label Nov 17, 2021
@vstinner

vstinner commented Nov 30, 2021

Copy link
Copy Markdown
Member Author

The PEP 670 is not accepted yet. This PR does two things:

  • (1) disallow using macros as l-value
  • (2) convert macros to static inline functions

Since both changes seem to be controversial, I prefer to limit the change to (1): I wrote the PR #28976 for that. I abandon this PR for now.

Once the (1) change will be done and the PEP 670 will be accepted, it will be non controversial to convert these macros to static inline functions.

For now, I prefer to abandon this PR.

All reactions

Sorry, something went wrong.

Uh oh!

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

@vstinner vstinner closed this Nov 30, 2021
@vstinner
vstinner deleted the macro_as branch November 30, 2021 14:08
@vstinner vstinner mentioned this pull request Jul 27, 2022
[C API] PEP 674: Disallow using macros (Py_TYPE and Py_SIZE) as l-value #89639
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@AA-Turner AA-Turner Awaiting requested review from AA-Turner AA-Turner will be requested when the pull request is marked ready for review AA-Turner is a code owner

Uh oh!

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

Assignees

No one assigned

Labels

awaiting core review

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

3 participants

@vstinner @the-knights-who-say-ni @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.