]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Enhanced sqlite3 connection context management documentation with contextlib.closing...
authorLincoln <71312724+Lincoln-developer@users.noreply.github.com>
Tue, 3 Oct 2023 14:32:43 +0000 (17:32 +0300)
committerGitHub <noreply@github.com>
Tue, 3 Oct 2023 14:32:43 +0000 (17:32 +0300)
* Enhanced sqlite3 connection context management documentation with contextlib.closing

* ðŸ“œðŸ¤– Added by blurb_it.

* Fixed gitignore spelling error from nitignore to gitignore

* Renamed .gitignore to .nitignore

* Added generated doctests

* Deleted sqlite3 generated files

* Removed white-space changes

* Removed News entry from the doc

* Expanded a note that context manager can be used for connection management using contextlib.closing

* Removed repeated contextlib.closing code snippet

* Expanded the note around usage of context manageer for sqlite3 connection management

* Deleted extra white-spaces

* Deleted extra white-space

* re-arranged context manager wording

* Re-arranged word layout on how to use context manager

* Fix whitespace errors

* Remove unneeded change in .gitignore

* Added suggested changes

* Added suggested change redirecting to the contextlib.closing implementation

* Added closing keyword

* Removed line 2473

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
Doc/library/sqlite3.rst

index 7b8c7810165164b6dd7b8b6ca664487a6a0ed463..aa34bcc9388e1c9c5bfaccffb3e1953fea6d2ae1 100644 (file)
@@ -2437,9 +2437,9 @@ or if :attr:`~Connection.autocommit` is ``True``,
 the context manager does nothing.
 
 .. note::
-
    The context manager neither implicitly opens a new transaction
-   nor closes the connection.
+   nor closes the connection. If you need a closing context manager, consider
+   using :meth:`contextlib.closing`.
 
 .. testcode::