Navigation Menu

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

global function _add_one_to_index_C #47351

Closed
loewis mannequin opened this issue Jun 13, 2008 · 11 comments
Closed

global function _add_one_to_index_C #47351

loewis mannequin opened this issue Jun 13, 2008 · 11 comments
Assignees

Comments

@loewis
Copy link
Mannequin

loewis mannequin commented Jun 13, 2008

BPO 3101
Nosy @loewis, @birkenfeld, @doko42, @pitrou

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/pitrou'
closed_at = <Date 2010-09-01.13:03:11.110>
created_at = <Date 2008-06-13.07:30:19.652>
labels = []
title = 'global function _add_one_to_index_C'
updated_at = <Date 2010-09-01.13:03:11.107>
user = 'https://github.com/loewis'

bugs.python.org fields:

activity = <Date 2010-09-01.13:03:11.107>
actor = 'pitrou'
assignee = 'pitrou'
closed = True
closed_date = <Date 2010-09-01.13:03:11.110>
closer = 'pitrou'
components = []
creation = <Date 2008-06-13.07:30:19.652>
creator = 'loewis'
dependencies = []
files = []
hgrepos = []
issue_num = 3101
keywords = []
message_count = 11.0
messages = ['68133', '68495', '68499', '71738', '71879', '77353', '77363', '77368', '77373', '114623', '115294']
nosy_count = 6.0
nosy_names = ['loewis', 'georg.brandl', 'doko', 'teoliphant', 'pitrou', 'riq']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue3101'
versions = ['Python 3.1', 'Python 2.7', 'Python 3.2']

@loewis
Copy link
Mannequin Author

loewis mannequin commented Jun 13, 2008

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.

@loewis loewis mannequin assigned teoliphant Jun 13, 2008
@riq
Copy link
Mannequin

riq mannequin commented Jun 21, 2008

This seems to be fixed in r62348
http://svn.python.org/view?rev=62348&view=rev

@loewis
Copy link
Mannequin Author

loewis mannequin commented Jun 21, 2008

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).

@pitrou
Copy link
Member

pitrou commented Aug 22, 2008

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.

@teoliphant
Copy link
Mannequin

teoliphant mannequin commented Aug 24, 2008

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,2

@loewis loewis mannequin changed the title global function _add_one_to_C global function _add_one_to_index_C Dec 8, 2008
@loewis
Copy link
Mannequin Author

loewis mannequin commented Dec 8, 2008

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_.

@pitrou
Copy link
Member

pitrou commented Dec 8, 2008

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).

@loewis
Copy link
Mannequin Author

loewis mannequin commented Dec 8, 2008

I think they currently are private functions which happen to be used
accross two different C source files.

But see msg71879

@pitrou
Copy link
Member

pitrou commented Dec 8, 2008

Well, then a proper API should be devised. Perhaps Travis can shed more
light on what he thinks would be useful.

@birkenfeld
Copy link
Member

Functions are still present and non-static in trunk.

@birkenfeld birkenfeld assigned pitrou and unassigned teoliphant Aug 22, 2010
@pitrou
Copy link
Member

pitrou commented Sep 1, 2010

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.

@pitrou pitrou closed this as completed Sep 1, 2010
@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
None yet
Projects
None yet
Development

No branches or pull requests

2 participants