Issue 3101: global function _add_one_to_index_C
Created on 2008-06-13 07:30 by loewis, last changed 2022-04-11 14:56 by admin. This issue is now closed.
Messages (11)
msg68133 - (view)
Author: Martin v. Löwis (loewis) *
Date: 2008-06-13 07:30
Date: 2008-06-21 15:13
Date: 2008-08-22 09:55
Date: 2008-08-24 21:34
Date: 2008-12-08 22:12
Date: 2008-12-08 23:28
Date: 2008-12-08 23:44
Date: 2008-12-08 23:55
Date: 2010-08-22 00:22
Date: 2010-09-01 13:03
Date: 2008-06-13 07:30
abstract.c defines two functions _add_one_to_C and _add_one_to_F. These apparently must be global, as memoryobject.c references them. Therefore, they should get a Py or _Py prefix. A short comment for what these functions actually do would also be appreciated.msg68495 - (view) Author: Ricardo Quesada (riq) Date: 2008-06-21 14:29
This seems to be fixed in r62348 http://svn.python.org/view?rev=62348&view=revmsg68499 - (view) Author: Martin v. Löwis (loewis) *
Date: 2008-06-21 15:13
Ok, so it's fixed for the trunk, but not Py3k. The trunk fix doesn't port to 3k, since the functions are called inside memoryobject.c (so making them static would break that module).msg71738 - (view) Author: Antoine Pitrou (pitrou) *
Date: 2008-08-22 09:55
A sensible solution would be to put all the memoryview / buffer API stuff in the same standalone file (e.g. memoryobject.c), rather than having half of it dumped in abstract.c.msg71879 - (view) Author: Travis Oliphant (teoliphant) *
Date: 2008-08-24 21:34
I've added comments in the code to document these functions. I have no opinion where they live except they should probably be available to extensions modules. These routines increment an N-length counter representing a position in an N-dimensional array with wrap-around when the counter reaches the size of the dimension. Thus, for a (2,3) array we have: F-version 0,0 1,0 2,0 0,1 1,1 2,1 C-version 0,0 0,1 0,2 1,0 1,1 1,2msg77353 - (view) Author: Martin v. Löwis (loewis) *
Date: 2008-12-08 22:12
I think _add_one_to_index_C and _add_one_to_index_F should be renamed. If they are meant to be called by non-core extension modules, their names should start with Py_, else with _Py_.msg77363 - (view) Author: Antoine Pitrou (pitrou) *
Date: 2008-12-08 23:28
I think they currently are private functions which happen to be used accross two different C source files. So they should be renamed _Py_something (or the situation should be fixed so that they can be made static).msg77368 - (view) Author: Martin v. Löwis (loewis) *
Date: 2008-12-08 23:44
> I think they currently are private functions which happen to be used > accross two different C source files. But see msg71879msg77373 - (view) Author: Antoine Pitrou (pitrou) *
Date: 2008-12-08 23:55
Well, then a proper API should be devised. Perhaps Travis can shed more light on what he thinks would be useful.msg114623 - (view) Author: Georg Brandl (georg.brandl) *
Date: 2010-08-22 00:22
Functions are still present and non-static in trunk.msg115294 - (view) Author: Antoine Pitrou (pitrou) *
Date: 2010-09-01 13:03
I've added a "_Py" prefix in r84391, and also made the `shape` argument const. If numpy people want this to be an official public API, they'll have to contribute. Thanks.
History
Date
User
Action
Args
2022-04-11 14:56:35adminsetgithub: 47351
2010-09-01 13:03:11pitrousetstatus: open -> closed
versions: + Python 3.1, Python 2.7, Python 3.2, - Python 3.0
messages: + msg115294
2008-12-08 23:55:36pitrousetmessages: + msg77373 2008-12-08 23:44:48loewissetmessages: + msg77368 2008-12-08 23:28:11pitrousetmessages: + msg77363 2008-12-08 22:12:24loewissetmessages: + msg77353 2008-12-08 22:10:27loewissettitle: global function _add_one_to_C -> global function _add_one_to_index_C 2008-08-24 21:34:27teoliphantsetmessages: + msg71879 2008-08-22 09:55:48pitrousetmessages: + msg71738 2008-08-22 09:53:46pitrousetnosy: + pitrou 2008-06-21 15:13:59loewissetmessages: + msg68499
versions: - Python 2.6 2008-06-21 14:30:03riqsetnosy: + riq
messages: + msg68495 2008-06-13 07:30:19loewiscreate
versions: + Python 3.1, Python 2.7, Python 3.2, - Python 3.0
messages: + msg115294
resolution: fixed
stage: resolved
messages:
+ msg114623
nosy:
+ georg.brandl
2008-12-08 23:55:36pitrousetmessages: + msg77373 2008-12-08 23:44:48loewissetmessages: + msg77368 2008-12-08 23:28:11pitrousetmessages: + msg77363 2008-12-08 22:12:24loewissetmessages: + msg77353 2008-12-08 22:10:27loewissettitle: global function _add_one_to_C -> global function _add_one_to_index_C 2008-08-24 21:34:27teoliphantsetmessages: + msg71879 2008-08-22 09:55:48pitrousetmessages: + msg71738 2008-08-22 09:53:46pitrousetnosy: + pitrou 2008-06-21 15:13:59loewissetmessages: + msg68499
versions: - Python 2.6 2008-06-21 14:30:03riqsetnosy: + riq
messages: + msg68495 2008-06-13 07:30:19loewiscreate