Skip to content

gh-80527: Deprecate PEP 623 Unicode functions - #91801

Merged
vstinner merged 2 commits into
python:mainfrom
vstinner:unicode_deprecate
Apr 22, 2022
Merged

vstinner merged 2 commits into
python:mainfrom
vstinner:unicode_deprecate

Conversation

@vstinner

Copy link
Copy Markdown
Member

Deprecate functions:

  • PyUnicode_AS_DATA()
  • PyUnicode_AS_UNICODE()
  • PyUnicode_GET_DATA_SIZE()
  • PyUnicode_GET_SIZE()

Previously, these functions were macros and so it wasn't possible to
decorate them with Py_DEPRECATED().

Deprecate functions:

* PyUnicode_AS_DATA()
* PyUnicode_AS_UNICODE()
* PyUnicode_GET_DATA_SIZE()
* PyUnicode_GET_SIZE()

Previously, these functions were macros and so it wasn't possible to
decorate them with Py_DEPRECATED().
@vstinner

Copy link
Copy Markdown
Member Author

@methane @serhiy-storchaka: Would one of you review this change? Thanks.

@vstinner

Copy link
Copy Markdown
Member Author

I converted these macros to functions in commit 636ad7b.

@methane

methane commented Apr 22, 2022

Copy link
Copy Markdown
Member

Previously, these functions were macros and so it wasn't possible to
decorate them with Py_DEPRECATED().

FWIW, use of these macros caused deprecation warning because wstr and wstr_length are deprecated.

@vstinner

Copy link
Copy Markdown
Member Author

FWIW, use of these macros caused deprecation warning because wstr and wstr_length are deprecated.

Oh ok, nice!

@vstinner
vstinner merged commit 9e146bb into python:main Apr 22, 2022
@vstinner
vstinner deleted the unicode_deprecate branch April 22, 2022 11:05
@vstinner

Copy link
Copy Markdown
Member Author

Well, I prefer to make it extra explicit that these functions will be removed soon (Python 3.12) ;-) I'm impatient, I would like to see wstr being removed as soon as possible, I hate the PyUnicode_READY() function!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants