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

[Doc] sqlite3 Cursor.execute() return value is unspecified #90923

Closed
kephas mannequin opened this issue Feb 16, 2022 · 3 comments · Fixed by #91643
Closed

[Doc] sqlite3 Cursor.execute() return value is unspecified #90923

kephas mannequin opened this issue Feb 16, 2022 · 3 comments · Fixed by #91643
Labels
3.9 only security fixes 3.10 only security fixes 3.11 only security fixes docs Documentation in the Doc dir stdlib Python modules in the Lib dir topic-sqlite3

Comments

@kephas
Copy link
Mannequin

kephas mannequin commented Feb 16, 2022

BPO 46767
Nosy @erlend-aasland, @kephas

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 = None
created_at = <Date 2022-02-16.11:16:39.049>
labels = ['3.7', '3.8', '3.9', '3.10', '3.11', 'type-feature', 'library']
title = '[Doc] sqlite3 Cursor.execute() return value is unspecified'
updated_at = <Date 2022-02-16.14:38:06.489>
user = 'https://github.com/kephas'

bugs.python.org fields:

activity = <Date 2022-02-16.14:38:06.489>
actor = 'erlendaasland'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2022-02-16.11:16:39.049>
creator = 'kephas'
dependencies = []
files = []
hgrepos = []
issue_num = 46767
keywords = []
message_count = 2.0
messages = ['413327', '413332']
nosy_count = 2.0
nosy_names = ['erlendaasland', 'kephas']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue46767'
versions = ['Python 3.7', 'Python 3.8', 'Python 3.9', 'Python 3.10', 'Python 3.11']

@kephas
Copy link
Mannequin Author

kephas mannequin commented Feb 16, 2022

In the documentation of the sqlite3 module, the return value for Connection.execute() is told to be the Cursor that was implicitly created, but nothing is said about the return value/type when using Cursor.execute().

@kephas kephas mannequin added 3.7 (EOL) end of life 3.8 (EOL) end of life 3.9 only security fixes 3.10 only security fixes 3.11 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Feb 16, 2022
@erlend-aasland
Copy link
Contributor

Quoting the docs:

This is a nonstandard shortcut that creates a cursor object by calling the
cursor() method, calls the cursor’s execute() method with the parameters
given, and returns the cursor.

There is already a backlink (or back reference) to the Connection.cursor() method, which again has a backlink to the Cursor class. What would you suggest to make things clearer?

How about the following rewording:

"[...] and returns the newly created cursor object".

(IMO this is too verbose; I'm fine with the current docs.)

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
@erlend-aasland erlend-aasland added docs Documentation in the Doc dir and removed type-feature A feature request or enhancement labels Apr 17, 2022
@erlend-aasland
Copy link
Contributor

After re-reading the current docs, I think a rewording might be helpful. I'll see if I can make things a little bit clearer.

erlend-aasland pushed a commit to erlend-aasland/cpython that referenced this issue Apr 17, 2022
- Drop 'nonstandard'; it does not add any value
- Try to be more concise
- Make return value a little more explicit
@AlexWaygood AlexWaygood removed 3.8 (EOL) end of life 3.7 (EOL) end of life labels Apr 17, 2022
JelleZijlstra pushed a commit that referenced this issue Apr 17, 2022
- Drop 'nonstandard'; it does not add any value
- Try to be more concise
- Make return value a little more explicit
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Apr 17, 2022
)

- Drop 'nonstandard'; it does not add any value
- Try to be more concise
- Make return value a little more explicit
(cherry picked from commit 017f07a)

Co-authored-by: Erlend Egeberg Aasland <[email protected]>
miss-islington added a commit that referenced this issue Apr 17, 2022
- Drop 'nonstandard'; it does not add any value
- Try to be more concise
- Make return value a little more explicit
(cherry picked from commit 017f07a)

Co-authored-by: Erlend Egeberg Aasland <[email protected]>
miss-islington added a commit that referenced this issue Apr 17, 2022
- Drop 'nonstandard'; it does not add any value
- Try to be more concise
- Make return value a little more explicit
(cherry picked from commit 017f07a)

Co-authored-by: Erlend Egeberg Aasland <[email protected]>
hello-adam pushed a commit to hello-adam/cpython that referenced this issue Jun 2, 2022
)

- Drop 'nonstandard'; it does not add any value
- Try to be more concise
- Make return value a little more explicit
(cherry picked from commit 017f07a)

Co-authored-by: Erlend Egeberg Aasland <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.9 only security fixes 3.10 only security fixes 3.11 only security fixes docs Documentation in the Doc dir stdlib Python modules in the Lib dir topic-sqlite3
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants