Issue 1629: Py_Size() should be named Py_SIZE() (original) (raw)

Created on 2007-12-14 19:45 by rhettinger, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (11)
msg58634 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2007-12-14 19:45
It would be helpful to have the name provide a cue that a macro is being used.
msg58635 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2007-12-14 19:54
Agreed.
msg58636 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2007-12-14 20:13
I assume that applies to Py_Refcnt and Py_Type as well?
msg58637 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2007-12-14 21:05
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.
msg58734 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2007-12-18 09:40
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
msg58793 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2007-12-19 06:47
I've renamed the three macros and added the old names for b/w compatibility.
msg58797 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2007-12-19 08:02
Why the compatibility?
msg58798 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2007-12-19 08:06
FWIW, should PyUnicode_Check, PyTuple_Check etc. also change to PyUnicode_CHECK, PyTuple_CHECK etc because they are macros?
msg58799 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2007-12-19 08:08
I've fixed PEP 3123 to update the spelling.
msg58818 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2007-12-19 18:37
> 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.
msg258838 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-01-22 21:17
New changeset 63183596db79 by Gregory P. Smith in branch '2.7': Per and : Document the Py_SIZE, Py_TYPE, Py_REFCNT macros. https://hg.python.org/cpython/rev/63183596db79
History
Date User Action Args
2022-04-11 14:56:29 admin set github: 45970
2016-01-22 21:17:59 python-dev set nosy: + python-devmessages: +
2007-12-19 18:37:04 gvanrossum set messages: +
2007-12-19 08:08:25 loewis set messages: +
2007-12-19 08:06:50 loewis set messages: +
2007-12-19 08:02:35 loewis set messages: +
2007-12-19 06:48:01 christian.heimes set status: open -> closedresolution: accepted -> fixedmessages: +
2007-12-18 19:14:56 gvanrossum set resolution: accepted
2007-12-18 09:40:43 christian.heimes set messages: +
2007-12-14 21:05:45 christian.heimes set nosy: + christian.heimesmessages: +
2007-12-14 20:13:27 loewis set messages: +
2007-12-14 19:54:30 gvanrossum set nosy: + gvanrossummessages: +
2007-12-14 19:45:41 rhettinger create