-
-
Notifications
You must be signed in to change notification settings - Fork 31.2k
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
Document PyUnicode_* API #46236
Comments
I was wandering whether the pointer returned by PyUnicode_AsString needs I notice that the documentation for several other unicode functions is PyUnicode_Resize It would probably be a good idea to polish up the documentation for |
In addition to the above mentioned functions I found these to be PyUnicode_DecodeUTF7 From the original list the following functions seem to have been removed: PyUnicode_InternImmortal I try to put together a patch for some of these during the weekend. |
Ok, here is my shot at a patch for at least some of the undocumented PyUnicode_FromFormat Please thoroughly review this patch since I didn't really digg into the |
The patch looks alright. I don't like the documentation for .. cfunction:: PyObject* PyUnicode_FromFormatV(const char *format, Equivalent to the function :cfunc:`PyUnicode_FromFormat`, except that |
Is it worth applying the patch given the complete rewrite of unicode for 3.3 via PEP-393? |
On 30.03.2013 13:09, Mark Lawrence wrote:
PEP-393 only changed the way Unicode is internally stored. |
Remaining undocumented functions: From this issue: PyUnicode_RSplit From bpo-10435: PyUnicode_IsIdentifier From bpo-18688: Py_UNICODE_REPLACEMENT_CHARACTER |
PyUnicode_DecodeCodePageStateful Following functions likely should be wrapped with "#ifndef Py_LIMITED_API": _PyUnicode_ClearStaticStrings |
""" _PyUnicode_ClearStaticStrings It's already the case since at least Python 3.7. Extract of Python 3.7 Include/unicodeobject.h: #ifndef Py_LIMITED_API
/* Return an interned Unicode object for an Identifier; may fail if there is no memory.*/
PyAPI_FUNC(PyObject*) _PyUnicode_FromId(_Py_Identifier*);
/* Clear all static strings. */
PyAPI_FUNC(void) _PyUnicode_ClearStaticStrings(void);
/* Fast equality check when the inputs are known to be exact unicode types
and where the hash values are equal (i.e. a very probable match) */
PyAPI_FUNC(int) _PyUnicode_EQ(PyObject *, PyObject *);
#endif /* !Py_LIMITED_API */ |
…eful` `PyUnicode_DecodeCodePageStateful` is in the limited C-API, and the document does not exist.
Co-authored-by: Stan Ulbrych <[email protected]> Co-authored-by: Peter Bierma <[email protected]>
…-127934) (cherry picked from commit 8d9d3e4) Co-authored-by: Yuki Kobayashi <[email protected]> Co-authored-by: Stan Ulbrych <[email protected]> Co-authored-by: Peter Bierma <[email protected]>
…-127934) (cherry picked from commit 8d9d3e4) Co-authored-by: Yuki Kobayashi <[email protected]> Co-authored-by: Stan Ulbrych <[email protected]> Co-authored-by: Peter Bierma <[email protected]>
…) (GH-129961) gh-46236: Document `PyUnicode_DecodeCodePageStateful` (GH-127934) (cherry picked from commit 8d9d3e4) Co-authored-by: Yuki Kobayashi <[email protected]> Co-authored-by: Stan Ulbrych <[email protected]> Co-authored-by: Peter Bierma <[email protected]>
…) (GH-129962) gh-46236: Document `PyUnicode_DecodeCodePageStateful` (GH-127934) (cherry picked from commit 8d9d3e4) Co-authored-by: Yuki Kobayashi <[email protected]> Co-authored-by: Stan Ulbrych <[email protected]> Co-authored-by: Peter Bierma <[email protected]>
I have noticed that some tasks that have already been opened are not checked off. I believe we should select them. |
…e_RPartition (#130191) Co-authored-by: Petr Viktorin <[email protected]>
…Unicode_RPartition (pythonGH-130191) (cherry picked from commit 0f5b821) Co-authored-by: Marc Mueller <[email protected]> Co-authored-by: Petr Viktorin <[email protected]>
…Unicode_RPartition (pythonGH-130191) (cherry picked from commit 0f5b821) Co-authored-by: Marc Mueller <[email protected]> Co-authored-by: Petr Viktorin <[email protected]>
…yUnicode_RPartition (GH-130191) (#130360) gh-46236: Document PyUnicode_RSplit, PyUnicode_Partition and PyUnicode_RPartition (GH-130191) (cherry picked from commit 0f5b821) Co-authored-by: Marc Mueller <[email protected]> Co-authored-by: Petr Viktorin <[email protected]>
…yUnicode_RPartition (GH-130191) (#130361) gh-46236: Document PyUnicode_RSplit, PyUnicode_Partition and PyUnicode_RPartition (GH-130191) (cherry picked from commit 0f5b821) Co-authored-by: Marc Mueller <[email protected]> Co-authored-by: Petr Viktorin <[email protected]>
* Clarify sys.getdefaultencoding() documentation * Add missing documentation for PyUnicode_GetDefaultEncoding, the C equivalent of sys.getdefaultencoding
…onGH-130335) * Clarify sys.getdefaultencoding() documentation * Add missing documentation for PyUnicode_GetDefaultEncoding, the C equivalent of sys.getdefaultencoding (cherry picked from commit 9f25c1f) Co-authored-by: RUANG (James Roy) <[email protected]>
…onGH-130335) * Clarify sys.getdefaultencoding() documentation * Add missing documentation for PyUnicode_GetDefaultEncoding, the C equivalent of sys.getdefaultencoding (cherry picked from commit 9f25c1f) Co-authored-by: RUANG (James Roy) <[email protected]>
…130335) (GH-130511) * Clarify sys.getdefaultencoding() documentation * Add missing documentation for PyUnicode_GetDefaultEncoding, the C equivalent of sys.getdefaultencoding (cherry picked from commit 9f25c1f) Co-authored-by: RUANG (James Roy) <[email protected]>
…130335) (GH-130512) * Clarify sys.getdefaultencoding() documentation * Add missing documentation for PyUnicode_GetDefaultEncoding, the C equivalent of sys.getdefaultencoding (cherry picked from commit 9f25c1f) Co-authored-by: RUANG (James Roy) <[email protected]>
Move deprecated PyUnicode API docs to new section Move Py_UNICODE to a new "Deprecated API" section. Formally soft-deprecate PyUnicode_READY, and move it Document and soft-deprecate PyUnicode_IS_READY, and move it Document PyUnicode_IS_ASCII, PyUnicode_CHECK_INTERNED PyUnicode_New docs: Clarify requirements for "fresh" strings PyUnicodeWriter_DecodeUTF8Stateful: Link "error-handlers" Co-authored-by: Serhiy Storchaka <[email protected]>
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
[edit @encukou]: Converting the lists below to checkboxes:
PyUnicode_InternImmortal(removed in 3.12)PyUnicode_SetDefaultEncoding(removed in 3.2)_PyUnicode_ClearStaticStrings(removed in 3.9)_PyUnicode_EQ(removed in 3.14)_PyUnicode_FromId(private)Linked PRs
PyUnicode_DecodeCodePageStateful
#127934PyUnicode_DecodeCodePageStateful
(GH-127934) #129961PyUnicode_DecodeCodePageStateful
(GH-127934) #129962The text was updated successfully, but these errors were encountered: