Skip to content

bpo-32077: Documentation: Some Unicode object functions don't indicate whether they return a new reference #4472

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

lioncash
Copy link
Contributor

@lioncash lioncash commented Nov 20, 2017

Also adds missing functions. Makes the documentation more comprehensive in terms of indicating whether or not a function returns a new reference.

I've gone over the entries quite a few times, and I'm fairly confident I've amended most of the existing functions and added the new ones that weren't yet added. If I've happened to miss any, just say the word and I'll add them.

I've also noticed the API documentation for bytes objects is also missing entries, which I've made a local commit for, but wasn't sure if it was a good idea to intermix it in this change. I can PR it separately or include it in this one depending on whichever is preferable.

https://bugs.python.org/issue32077

Also adds missing functions.

Makes the documentation more comprehensive in terms of indicating
whether or not a function returns a new reference.
@lioncash lioncash changed the title bpo-32077: Some Unicode object functions don't indicate whether they return a new reference bpo-32077: Documentation: Some Unicode object functions don't indicate whether they return a new reference Nov 20, 2017
PyUnicode_AsWideChar:int:::
PyUnicode_AsWideChar:PyObject*:*unicode:0:
PyUnicode_AsWideChar:Py_ssize_t:::
PyUnicode_AsWideChar:PyUnicodeObject*:unicode:0:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PyObject

PyUnicode_Decode:const char*:encoding::
PyUnicode_Decode:const char*:errors::

PyUnicode_DecodeUTF16Stateful:PyObject*::+1:
PyUnicode_DecodeUTF16Stateful:const char*:s::
PyUnicode_DecodeUTF16Stateful:int:size::
PyUnicode_DecodeUTF16Stateful:Py_ssize_t:size::
PyUnicode_DecodeUTF16Stateful:const char*:errors::
PyUnicode_DecodeUTF16Stateful:int*:byteorder::
PyUnicode_DecodeUTF16Stateful:int*:consumed::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Py_ssize_t

PyUnicode_DecodeUTF16Stateful:const char*:errors::
PyUnicode_DecodeUTF16Stateful:int*:byteorder::
PyUnicode_DecodeUTF16Stateful:int*:consumed::

PyUnicode_DecodeUTF8Stateful:PyObject*::+1:
PyUnicode_DecodeUTF8Stateful:const char*:s::
PyUnicode_DecodeUTF8Stateful:int:size::
PyUnicode_DecodeUTF8Stateful:Py_ssize_t:size::
PyUnicode_DecodeUTF8Stateful:const char*:errors::
PyUnicode_DecodeUTF8Stateful:int*:consumed::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Py_ssize_t


PyUnicode_AsUTF8AndSize:const char*:::
PyUnicode_AsUTF8AndSize:PyObject*:unicode:0:

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PyUnicode_AsUTF8AndSize:Py_ssize_t*:size::

PyUnicode_DecodeRawUnicodeEscape:const char*:errors::

PyUnicode_EncodeRawUnicodeEscape:PyObject*::+1:
PyUnicode_EncodeRawUnicodeEscape:const Py_UNICODE*:s::
PyUnicode_EncodeRawUnicodeEscape:int:size::
PyUnicode_EncodeRawUnicodeEscape:Py_ssize_t:size::
PyUnicode_EncodeRawUnicodeEscape:const char*:errors::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove.

PyUnicode_InternFromString:const char*:cp::

PyUnicode_New:PyObject*::+1:
PyUnicode_New:Py_UCS4:maxchar::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Insert PyUnicode_New:Py_ssize_t:size::.

@lioncash
Copy link
Contributor Author

lioncash commented Dec 19, 2018

I've recreated the pull request in #11243, with the feedback addressed, as I mistakenly thought this was addressed in the past and removed my fork on github, which seems to have orphaned this pull request. I'm really sorry about that. Will close this one.

@lioncash lioncash closed this Dec 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants