Skip to content

Conversation

vstinner
Copy link
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
Member Author

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

@vstinner
Copy link
Member Author

I converted these macros to functions in commit 636ad7b.

@methane
Copy link
Member

methane commented Apr 22, 2022

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
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
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants