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

Py_Size() should be named Py_SIZE() #45970

Closed
rhettinger opened this issue Dec 14, 2007 · 11 comments
Closed

Py_Size() should be named Py_SIZE() #45970

rhettinger opened this issue Dec 14, 2007 · 11 comments
Assignees
Labels
extension-modules C modules in the Modules dir

Comments

@rhettinger
Copy link
Contributor

BPO 1629
Nosy @gvanrossum, @loewis, @rhettinger, @tiran

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/loewis'
closed_at = <Date 2007-12-19.06:48:01.900>
created_at = <Date 2007-12-14.19:45:41.214>
labels = ['extension-modules']
title = 'Py_Size() should be named Py_SIZE()'
updated_at = <Date 2016-01-22.21:17:59.886>
user = 'https://github.com/rhettinger'

bugs.python.org fields:

activity = <Date 2016-01-22.21:17:59.886>
actor = 'python-dev'
assignee = 'loewis'
closed = True
closed_date = <Date 2007-12-19.06:48:01.900>
closer = 'christian.heimes'
components = ['Extension Modules']
creation = <Date 2007-12-14.19:45:41.214>
creator = 'rhettinger'
dependencies = []
files = []
hgrepos = []
issue_num = 1629
keywords = []
message_count = 11.0
messages = ['58634', '58635', '58636', '58637', '58734', '58793', '58797', '58798', '58799', '58818', '258838']
nosy_count = 5.0
nosy_names = ['gvanrossum', 'loewis', 'rhettinger', 'christian.heimes', 'python-dev']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue1629'
versions = ['Python 2.6']

@rhettinger
Copy link
Contributor Author

It would be helpful to have the name provide a cue that a macro is being
used.

@rhettinger rhettinger added the extension-modules C modules in the Modules dir label Dec 14, 2007
@gvanrossum
Copy link
Member

Agreed.

@loewis
Copy link
Mannequin

loewis mannequin commented Dec 14, 2007

I assume that applies to Py_Refcnt and Py_Type as well?

@tiran
Copy link
Member

tiran commented Dec 14, 2007

I think it would be easier to merge from trunk to py3k before the change
and skip the revision in the next merge. The rename can be done with a
simple find | xargs sed -i. A merge might be more painful.

@tiran
Copy link
Member

tiran commented Dec 18, 2007

I tried a simple find | xargs sed replace and it worked well.

find -name '*.c' -or -name '*.h' -or -name '*.rst' | xargs sed -i
s/Py_Size\(/Py_SIZE\(/g

@tiran
Copy link
Member

tiran commented Dec 19, 2007

I've renamed the three macros and added the old names for b/w compatibility.

@tiran tiran closed this as completed Dec 19, 2007
@loewis
Copy link
Mannequin

loewis mannequin commented Dec 19, 2007

Why the compatibility?

@loewis
Copy link
Mannequin

loewis mannequin commented Dec 19, 2007

FWIW, should PyUnicode_Check, PyTuple_Check etc. also change to
PyUnicode_CHECK, PyTuple_CHECK etc because they are macros?

@loewis
Copy link
Mannequin

loewis mannequin commented Dec 19, 2007

I've fixed PEP-3123 to update the spelling.

@gvanrossum
Copy link
Member

FWIW, should PyUnicode_Check, PyTuple_Check etc. also change to
PyUnicode_CHECK, PyTuple_CHECK etc because they are macros?

While this would technically be the right thing to do, those macros
have had a long and productive life before 2.6 so I'd rather be
compatible. IOW no.

@python-dev
Copy link
Mannequin

python-dev mannequin commented Jan 22, 2016

New changeset 63183596db79 by Gregory P. Smith in branch '2.7':
Per bpo-21949 and bpo-1629: Document the Py_SIZE, Py_TYPE, Py_REFCNT macros.
https://hg.python.org/cpython/rev/63183596db79

@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
extension-modules C modules in the Modules dir
Projects
None yet
Development

No branches or pull requests

3 participants