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-1635741: Move _PyUnicode_Name_CAPI to the internal C API by vstinner · Pull Request #22713 · python/cpython

Conversation

@vstinner

@vstinner vstinner commented Oct 15, 2020 •
edited by bedevere-bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

getcode() and getname() functions of _PyUnicode_Name_CAPI get an
additional parameter: state.

  • Move Include/ucnhash.h to Include/internal/pycore_ucnhash.h
  • unicodedata module is now built with Py_BUILD_CORE_MODULE.
  • unicodedata: move the CAPI into unicodedata_module_state.

https://bugs.python.org/issue1635741

Sorry, something went wrong.

Uh oh!

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

All reactions
@vstinner vstinner added the skip news label Oct 15, 2020
@vstinner
vstinner requested a review from a team as a code owner October 15, 2020 14:24
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Oct 15, 2020
@bedevere-bot bedevere-bot added the awaiting core review label Oct 15, 2020
@vstinner

vstinner commented Oct 15, 2020

Copy link
Copy Markdown
Member Author

Hum, I should document the change at https://docs.python.org/dev/whatsnew/3.10.html#c-api-changes

All reactions

Sorry, something went wrong.

Uh oh!

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

@vstinner
bpo-1635741: _PyUnicode_Name_CAPI moves to internal C API
a9cdbc8
The private _PyUnicode_Name_CAPI structure of the PyCapsule API
unicodedata.ucnhash_CAPI moves to the internal C API. Moreover, the
structure gets a new state member which must be passed to the
getcode() and getname() functions.

* Move Include/ucnhash.h to Include/internal/pycore_ucnhash.h
* unicodedata module is now built with Py_BUILD_CORE_MODULE.
* unicodedata: move hashAPI variable into unicodedata_module_state.
@vstinner

vstinner commented Oct 16, 2020

Copy link
Copy Markdown
Member Author

@koubaa: With this PR, it becomes way simpler to move global_module_state into a proper module state. Next steps:

  • PR 1: Convert UCD_Type static type to a heap type
  • PR 2: Add "defining_class" to Argument Clinic, get the module type from defining class
All reactions

Sorry, something went wrong.

Uh oh!

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

@koubaa

koubaa commented Oct 19, 2020

Copy link
Copy Markdown
Contributor

@vstinner I'll give PR1 a shot this week. Thanks for the groundwork

All reactions

Sorry, something went wrong.

Uh oh!

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

@vstinner
vstinner merged commit 47e1afd into python:master Oct 26, 2020
@bedevere-bot bedevere-bot removed the awaiting core review label Oct 26, 2020
@vstinner
vstinner deleted the ucnhash_capi branch October 26, 2020 15:43
@vstinner

vstinner commented Oct 26, 2020

Copy link
Copy Markdown
Member Author

See https://bugs.python.org/issue42157 for the follow-up.

All reactions

Sorry, something went wrong.

Uh oh!

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

shihai1991 added a commit to shihai1991/cpython that referenced this pull request Oct 29, 2020
@shihai1991
Merge remote-tracking branch 'origin/master' into bpo_41073_add_types…
b3f992a
…lots1

* origin/master: (365 commits)
  bpo-42029: Remove IRIX code (pythonGH-23023)
  bpo-42143: Ensure PyFunction_NewWithQualName() can't fail after creating the func object (pythonGH-22953)
  bpo-34204: Use pickle.DEFAULT_PROTOCOL in shelve (pythonGH-19639)
  bpo-41805: Documentation for PEP 585 (pythonGH-22615)
  bpo-42161: Micro-optimize _collections._count_elements() (pythonGH-23008)
  bpo-42161: Remove private _PyLong_Zero and _PyLong_One (pythonGH-23003)
  bpo-42099: Fix reference to ob_type in unionobject.c and ceval (pythonGH-22829)
  bpo-41659: Disallow curly brace directly after primary (pythonGH-22996)
  bpo-6761: Enhance __call__ documentation (pythonGH-7987)
  bpo-42161: Modules/ uses _PyLong_GetZero() and _PyLong_GetOne() (pythonGH-22998)
  bpo-41474, Makefile: Add dependency on cpython/frameobject.h (pythonGH-22999)
  bpo-42157: Rename unicodedata.ucnhash_CAPI (pythonGH-22994)
  bpo-42161: Use _PyLong_GetZero() and _PyLong_GetOne() (pythonGH-22995)
  bpo-30681: Support invalid date format or value in email Date header (pythonGH-22090)
  bpo-42161: Add _PyLong_GetZero() and _PyLong_GetOne() (pythonGH-22993)
  bpo-42123: Run the parser two times and only enable invalid rules on the second run (pythonGH-22111)
  bpo-42157: Convert unicodedata.UCD to heap type (pythonGH-22991)
  bpo-42157: unicodedata avoids references to UCD_Type (pythonGH-22990)
  bpo-39101: Fixes BaseException hang in IsolatedAsyncioTestCase. (pythonGH-22654)
  bpo-1635741: _PyUnicode_Name_CAPI moves to internal C API (pythonGH-22713)
  ...
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
@vstinner @adorilson
bpo-1635741: _PyUnicode_Name_CAPI moves to internal C API (pythonGH-2…
5ad787a
…2713)

The private _PyUnicode_Name_CAPI structure of the PyCapsule API
unicodedata.ucnhash_CAPI moves to the internal C API. Moreover, the
structure gets a new state member which must be passed to the
getcode() and getname() functions.

* Move Include/ucnhash.h to Include/internal/pycore_ucnhash.h
* unicodedata module is now built with Py_BUILD_CORE_MODULE.
* unicodedata: move hashAPI variable into unicodedata_module_state.
catap added a commit to catap/unicodedata2 that referenced this pull request Nov 16, 2021
@catap
Python 3.10 compatibility
b9ec052
Overstep python/cpython#22713
@catap catap mentioned this pull request Nov 16, 2021
Python 3.10 compatibility fonttools/unicodedata2#49
Merged
anthrotype pushed a commit to fonttools/unicodedata2 that referenced this pull request Nov 17, 2021
@catap
Python 3.10 compatibility (#49)
44409e0
Overstep python/cpython#22713
@kylotan kylotan mannequin mentioned this pull request Sep 19, 2022
Py_Finalize() doesn't clear all Python objects at exit #44470
Closed
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

skip news

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.

4 participants

@vstinner @koubaa @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.