Thanks to visit codestin.com
Credit goes to github.com

Skip to content

The documentation for ctypes may be ambiguous. #116851

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

Closed
jnchen opened this issue Mar 15, 2024 · 3 comments
Closed

The documentation for ctypes may be ambiguous. #116851

jnchen opened this issue Mar 15, 2024 · 3 comments
Labels
docs Documentation in the Doc dir

Comments

@jnchen
Copy link
Contributor

jnchen commented Mar 15, 2024

Documentation

image

In this picture, after "from ctypes import *" then use the "libc.printf" may misleading the reader that libc from ctypes.
i think should remove "from ctypes import *" then tell reader this snippet continue with the above code

Linked PRs

@hugovk
Copy link
Member

hugovk commented Mar 15, 2024

Shall we follow the advice in the FAQ and replace the other from ctypes import * with specific imports?

@Privat33r-dev
Copy link
Contributor

Privat33r-dev commented Mar 15, 2024

Shall we follow the advice in the FAQ and replace the other from ctypes import * with specific imports?

Sounds like a good idea. The whole doc seem inconsistent with import statements, probably they should be rearranged as well. I checked datetime and it appears that imports are in each example, but the style of this article differs a lot.

@Privat33r-dev
Copy link
Contributor

@jnchen Thanks for the issue and PR, you make a good point

serhiy-storchaka pushed a commit that referenced this issue Mar 16, 2024
…6852)

It is confusing, because libc is not imported from ctypes,
but defined in previous examples, which already contain the import.
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Mar 16, 2024
…ythonGH-116852)

It is confusing, because libc is not imported from ctypes,
but defined in previous examples, which already contain the import.
(cherry picked from commit 744c077)

Co-authored-by: jnchen <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Mar 16, 2024
…ythonGH-116852)

It is confusing, because libc is not imported from ctypes,
but defined in previous examples, which already contain the import.
(cherry picked from commit 744c077)

Co-authored-by: jnchen <[email protected]>
serhiy-storchaka pushed a commit that referenced this issue Mar 16, 2024
…GH-116852) (GH-116905)

It is confusing, because libc is not imported from ctypes,
but defined in previous examples, which already contain the import.
(cherry picked from commit 744c077)

Co-authored-by: jnchen <[email protected]>
serhiy-storchaka pushed a commit that referenced this issue Mar 16, 2024
…GH-116852) (GH-116906)

It is confusing, because libc is not imported from ctypes,
but defined in previous examples, which already contain the import.
(cherry picked from commit 744c077)

Co-authored-by: jnchen <[email protected]>
@hugovk hugovk closed this as completed Mar 16, 2024
vstinner pushed a commit to vstinner/cpython that referenced this issue Mar 20, 2024
…ythonGH-116852)

It is confusing, because libc is not imported from ctypes,
but defined in previous examples, which already contain the import.
adorilson pushed a commit to adorilson/cpython that referenced this issue Mar 25, 2024
…ythonGH-116852)

It is confusing, because libc is not imported from ctypes,
but defined in previous examples, which already contain the import.
diegorusso pushed a commit to diegorusso/cpython that referenced this issue Apr 17, 2024
…ythonGH-116852)

It is confusing, because libc is not imported from ctypes,
but defined in previous examples, which already contain the import.
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

3 participants