New submission from Serhiy Storchaka <storchaka+cpyt...@gmail.com>:

_PyUnicode_AsKind is exposed as private C API. It is only used in 
unicodeobject.c, where it is defined. Its name starts with an underscore, it is 
not documented and not included in PC/python3.def (therefore is not exported on 
Windows). Seems it is not used in third party code (I have not found any 
occurrences on GitHub except CPython clones).

Initially it was also used in Python/formatter_unicode.c, and I think it is the 
only reason of exposing it in the header. I think that now it can be removed.

The proposed PR removes _PyUnicode_AsKind from headers, makes it static, rename 
it, and change its signature (since all the kind, data pointer and length are 
available at the caller site). It also includes minor cleanup and 
microoptimizations.

----------
components: C API
messages: 365427
nosy: serhiy.storchaka, vstinner
priority: normal
severity: normal
status: open
title: Remove _PyUnicode_AsKind from private C API
type: enhancement
versions: Python 3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40130>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to