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

Incorrect type in PyDict_Next() example code #44418

Closed
jasonevans mannequin opened this issue Jan 5, 2007 · 2 comments
Closed

Incorrect type in PyDict_Next() example code #44418

jasonevans mannequin opened this issue Jan 5, 2007 · 2 comments
Labels
docs Documentation in the Doc dir

Comments

@jasonevans
Copy link
Mannequin

jasonevans mannequin commented Jan 5, 2007

BPO 1629125
Nosy @birkenfeld

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 = None
closed_at = <Date 2007-01-17.21:20:53.000>
created_at = <Date 2007-01-05.23:15:47.000>
labels = ['docs']
title = 'Incorrect type in PyDict_Next() example code'
updated_at = <Date 2007-01-17.21:20:53.000>
user = 'https://bugs.python.org/jasonevans'

bugs.python.org fields:

activity = <Date 2007-01-17.21:20:53.000>
actor = 'georg.brandl'
assignee = 'nnorwitz'
closed = True
closed_date = None
closer = None
components = ['Documentation']
creation = <Date 2007-01-05.23:15:47.000>
creator = 'jasonevans'
dependencies = []
files = []
hgrepos = []
issue_num = 1629125
keywords = []
message_count = 2.0
messages = ['30934', '30935']
nosy_count = 3.0
nosy_names = ['nnorwitz', 'georg.brandl', 'jasonevans']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue1629125'
versions = []

@jasonevans
Copy link
Mannequin Author

jasonevans mannequin commented Jan 5, 2007

In the PyDict_Next() documentation, there are two example snippets of code. In both snippets, the line:

    int pos = 0;

should instead be:

ssize_t pos = 0;

or perhaps:

    Py_ssize_t pos = 0;

On an LP64 system, the unfixed snippets will cause a compiler warning due to size mismatch between int and ssize_t.

Using Python 2.5 on RHEL WS 4, x86_64.

@jasonevans jasonevans mannequin closed this as completed Jan 5, 2007
@jasonevans jasonevans mannequin assigned nnorwitz Jan 5, 2007
@jasonevans jasonevans mannequin added the docs Documentation in the Doc dir label Jan 5, 2007
@jasonevans jasonevans mannequin closed this as completed Jan 5, 2007
@jasonevans jasonevans mannequin assigned nnorwitz Jan 5, 2007
@jasonevans jasonevans mannequin added the docs Documentation in the Doc dir label Jan 5, 2007
@birkenfeld
Copy link
Member

Yep, it has to be Py_ssize_t. Fixed in rev. 53477, 53478 (2.5).

@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
docs Documentation in the Doc dir
Projects
None yet
Development

No branches or pull requests

1 participant