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

Skip to content

Commit d404fa6

Browse files
committed
Update module names in references in the FAQ.
1 parent d741315 commit d404fa6

2 files changed

Lines changed: 11 additions & 15 deletions

File tree

Doc/faq/library.rst

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -232,11 +232,9 @@ Threads
232232
How do I program using threads?
233233
-------------------------------
234234

235-
.. XXX it's _thread in py3k
236-
237-
Be sure to use the :mod:`threading` module and not the :mod:`thread` module.
235+
Be sure to use the :mod:`threading` module and not the :mod:`_thread` module.
238236
The :mod:`threading` module builds convenient abstractions on top of the
239-
low-level primitives provided by the :mod:`thread` module.
237+
low-level primitives provided by the :mod:`_thread` module.
240238

241239
Aahz has a set of slides from his threading tutorial that are helpful; see
242240
http://starship.python.net/crew/aahz/OSCON2001/.
@@ -280,16 +278,16 @@ A simple fix is to add a tiny sleep to the start of the run function::
280278

281279
Instead of trying to guess how long a :func:`time.sleep` delay will be enough,
282280
it's better to use some kind of semaphore mechanism. One idea is to use the
283-
:mod:`Queue` module to create a queue object, let each thread append a token to
281+
:mod:`queue` module to create a queue object, let each thread append a token to
284282
the queue when it finishes, and let the main thread read as many tokens from the
285283
queue as there are threads.
286284

287285

288286
How do I parcel out work among a bunch of worker threads?
289287
---------------------------------------------------------
290288

291-
Use the :mod:`Queue` module to create a queue containing a list of jobs. The
292-
:class:`~Queue.Queue` class maintains a list of objects with ``.put(obj)`` to
289+
Use the :mod:`queue` module to create a queue containing a list of jobs. The
290+
:class:`~queue.Queue` class maintains a list of objects with ``.put(obj)`` to
293291
add an item to the queue and ``.get()`` to return an item. The class will take
294292
care of the locking necessary to ensure that each job is handed out exactly
295293
once.
@@ -777,11 +775,10 @@ Are there any interfaces to database packages in Python?
777775

778776
Yes.
779777

780-
.. XXX remove bsddb in py3k, fix other module names
781-
782-
Python 2.3 includes the :mod:`bsddb` package which provides an interface to the
783-
BerkeleyDB library. Interfaces to disk-based hashes such as :mod:`DBM <dbm>`
784-
and :mod:`GDBM <gdbm>` are also included with standard Python.
778+
Interfaces to disk-based hashes such as :mod:`DBM <dbm.ndbm>` and :mod:`GDBM
779+
<dbm.gnu>` are also included with standard Python. There is also the
780+
:mod:`sqlite3` module, which provides a lightweight disk-based relational
781+
database.
785782

786783
Support for most relational databases is available. See the
787784
`DatabaseProgramming wiki page
@@ -794,8 +791,7 @@ How do you implement persistent objects in Python?
794791
The :mod:`pickle` library module solves this in a very general way (though you
795792
still can't store things like open files, sockets or windows), and the
796793
:mod:`shelve` library module uses pickle and (g)dbm to create persistent
797-
mappings containing arbitrary Python objects. For better performance, you can
798-
use the :mod:`cPickle` module.
794+
mappings containing arbitrary Python objects.
799795

800796
A more awkward way of doing things is to use pickle's little sister, marshal.
801797
The :mod:`marshal` module provides very fast ways to store noncircular basic

Doc/faq/programming.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ What are the "best practices" for using import in a module?
364364
In general, don't use ``from modulename import *``. Doing so clutters the
365365
importer's namespace. Some people avoid this idiom even with the few modules
366366
that were designed to be imported in this manner. Modules designed in this
367-
manner include :mod:`Tkinter`, and :mod:`threading`.
367+
manner include :mod:`tkinter`, and :mod:`threading`.
368368

369369
Import modules at the top of a file. Doing so makes it clear what other modules
370370
your code requires and avoids questions of whether the module name is in scope.

0 commit comments

Comments
 (0)