Skip to content

Commit

Permalink
Enhanced sqlite3 connection context management documentation with con…
Browse files Browse the repository at this point in the history
…textlib.closing gh-109234 (#109322)

* 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>
  • Loading branch information
3 people authored Oct 3, 2023
1 parent 2d4865d commit 4227bfa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Doc/library/sqlite3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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::

Expand Down

0 comments on commit 4227bfa

Please sign in to comment.