Skip to content
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

Make _PyUnicode_AsString as public API #50472

Closed
bhy mannequin opened this issue Jun 6, 2009 · 2 comments
Closed

Make _PyUnicode_AsString as public API #50472

bhy mannequin opened this issue Jun 6, 2009 · 2 comments
Assignees
Labels
docs Documentation in the Doc dir extension-modules C modules in the Modules dir interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-unicode type-feature A feature request or enhancement

Comments

@bhy
Copy link
Mannequin

bhy mannequin commented Jun 6, 2009

BPO 6223
Nosy @birkenfeld, @benjaminp

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:

assignee = 'https://github.com/birkenfeld'
closed_at = <Date 2009-06-06.17:25:59.351>
created_at = <Date 2009-06-06.17:11:03.305>
labels = ['extension-modules', 'interpreter-core', 'type-feature', 'expert-unicode', 'docs']
title = 'Make _PyUnicode_AsString as public API'
updated_at = <Date 2009-06-06.17:25:59.344>
user = 'https://bugs.python.org/bhy'

bugs.python.org fields:

activity = <Date 2009-06-06.17:25:59.344>
actor = 'benjamin.peterson'
assignee = 'georg.brandl'
closed = True
closed_date = <Date 2009-06-06.17:25:59.351>
closer = 'benjamin.peterson'
components = ['Documentation', 'Extension Modules', 'Interpreter Core', 'Unicode']
creation = <Date 2009-06-06.17:11:03.305>
creator = 'bhy'
dependencies = []
files = []
hgrepos = []
issue_num = 6223
keywords = []
message_count = 2.0
messages = ['89007', '89008']
nosy_count = 3.0
nosy_names = ['georg.brandl', 'benjamin.peterson', 'bhy']
pr_nums = []
priority = 'normal'
resolution = 'rejected'
stage = None
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue6223'
versions = ['Python 3.1', 'Python 3.2']

@bhy
Copy link
Mannequin Author

bhy mannequin commented Jun 6, 2009

Why _PyUnicode_AsString and _PyUnicode_AsStringAndSize are not public
API? They are very useful when porting extension module to Python 3,
because they have the semantic as same as PyString_AsString. For
extension author, these API can be used for replacing PyString_AsString
without any other change in code logic.

So why not make these API public? Any consideration? If we can document
these API, then C extension author can know them and use them, without
spending a lot of time to dig them out from Python source code.

Thanks!

@bhy bhy mannequin assigned birkenfeld Jun 6, 2009
@bhy bhy mannequin added docs Documentation in the Doc dir extension-modules C modules in the Modules dir interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-unicode type-feature A feature request or enhancement labels Jun 6, 2009
@benjaminp
Copy link
Contributor

They are not public because implicitly encoding unicode is bad practice
in Python 3. You should use PyUnicode_AsEncodedString() or such.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir extension-modules C modules in the Modules dir interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-unicode type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants