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

PyLong and PyUnicode don't match the Python type names #14

Open
encukou opened this issue May 10, 2023 · 6 comments
Open

PyLong and PyUnicode don't match the Python type names #14

encukou opened this issue May 10, 2023 · 6 comments
Labels
evolution-proposed theme: implementation flaws problems with the implementation of specific APIs

Comments

@encukou
Copy link
Contributor

encukou commented May 10, 2023

No description provided.

@iritkatriel iritkatriel added the theme: implementation flaws problems with the implementation of specific APIs label May 10, 2023
@gvanrossum
Copy link

gvanrossum commented May 16, 2023

Could be solved with a (large) number of macros. But is it worth the churn? Over time, naming never remains fully consistent.

@encukou
Copy link
Contributor Author

encukou commented May 17, 2023

IMO, it's not worth the churn at all. But I have seen people trying to name new APIs with Int/Str prefixes. What to do there? IMO, we should be consistent with the existing names, unless we're overhauling all of the API.

cc @markshannon

Full disclosure: I maintain a Python 2/3 compat library that does stuff like alias PyInt_* to PyLong_*, which is technically abuse of the reserved Py namespace. But I don't think I'm the only one doing that.

@markshannon
Copy link

I agree it isn't worth the churn to change the current API, but it does provide a way to distinguish between old API (Long/Unicode) and new API (Int/Str) should we add a new API.

@serhiy-storchaka
Copy link

What is this new APIs with Int/Str prefixes? "Int" means "related to C int", "String" means "related to C char *". Having names with "Str" and "String" with very different meaning would confuse.

@markshannon
Copy link

Would it be that confusing?

Using Int to refer to the Python type is less confusing than Long. Only C has a long type, Python doesn't.

@encukou
Copy link
Contributor Author

encukou commented Oct 23, 2023

Guideline issue, where I propose to keep the old/consistent names: capi-workgroup/api-evolution#23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
evolution-proposed theme: implementation flaws problems with the implementation of specific APIs
Projects
None yet
Development

No branches or pull requests

5 participants