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

Skip to content

Commit 1e8cbe3

Browse files
committed
Merged revisions 75393,75416,75581,75609,75615 via svnmerge from
svn+ssh://svn.python.org/python/branches/py3k ................ r75393 | georg.brandl | 2009-10-13 18:55:12 +0200 (Di, 13 Okt 2009) | 1 line Update module names in references in the FAQ. ................ r75416 | georg.brandl | 2009-10-14 20:46:15 +0200 (Mi, 14 Okt 2009) | 1 line #7129: add missing function. ................ r75581 | georg.brandl | 2009-10-21 09:17:48 +0200 (Mi, 21 Okt 2009) | 9 lines Merged revisions 75580 via svnmerge from svn+ssh://[email protected]/python/trunk ........ r75580 | georg.brandl | 2009-10-21 09:15:59 +0200 (Mi, 21 Okt 2009) | 1 line #7170: fix explanation about non-weakrefable builtin types. ........ ................ r75609 | georg.brandl | 2009-10-22 17:16:26 +0200 (Do, 22 Okt 2009) | 1 line #7137: fix makefile() documentation to match the new parameters. ................ r75615 | georg.brandl | 2009-10-22 18:08:10 +0200 (Do, 22 Okt 2009) | 1 line #6927: fix wrong word. ................
1 parent cb7cb24 commit 1e8cbe3

7 files changed

Lines changed: 27 additions & 27 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.

Doc/library/socket.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -565,17 +565,17 @@ correspond to Unix system calls applicable to sockets.
565565
is system-dependent (usually 5).
566566

567567

568-
.. method:: socket.makefile([mode[, bufsize]])
568+
.. method:: socket.makefile(mode='r', buffering=None, *, encoding=None, newline=None)
569569

570570
.. index:: single: I/O control; buffering
571571

572572
Return a :dfn:`file object` associated with the socket. (File objects are
573-
described in :ref:`bltin-file-objects`.) The file object
574-
references a :cfunc:`dup`\ ped version of the socket file descriptor, so the
575-
file object and socket object may be closed or garbage-collected independently.
576-
The socket must be in blocking mode (it can not have a timeout). The optional
577-
*mode* and *bufsize* arguments are interpreted the same way as by the built-in
578-
:func:`file` function.
573+
described in :ref:`bltin-file-objects`.) The file object references a
574+
:cfunc:`dup`\ ped version of the socket file descriptor, so the file object
575+
and socket object may be closed or garbage-collected independently. The
576+
socket must be in blocking mode (it can not have a timeout). The optional
577+
arguments are interpreted the same way as by the built-in :func:`open`
578+
function.
579579

580580

581581
.. method:: socket.recv(bufsize[, flags])

Doc/library/weakref.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ support weak references but can add support through subclassing::
6969

7070
obj = Dict(red=1, green=2, blue=3) # this object is weak referenceable
7171

72+
Other built-in types such as :class:`tuple` and :class:`int` do not support
73+
weak references even when subclassed (those types implemented as a
74+
:ctype:`PyVarObject`).
75+
7276
Extension types can easily be made to support weak references; see
7377
:ref:`weakref-support`.
7478

Doc/reference/compound_stmts.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -608,9 +608,9 @@ which is then bound to the class name.
608608
.. [#] The exception is propagated to the invocation stack only if there is no
609609
:keyword:`finally` clause that negates the exception.
610610
611-
.. [#] Currently, control "flows off the end" except in the case of an exception or the
612-
execution of a :keyword:`return`, :keyword:`continue`, or :keyword:`break`
613-
statement.
611+
.. [#] Currently, control "flows off the end" except in the case of an exception
612+
or the execution of a :keyword:`return`, :keyword:`continue`, or
613+
:keyword:`break` statement.
614614
615615
.. [#] A string literal appearing as the first statement in the function body is
616616
transformed into the function's ``__doc__`` attribute and therefore the

Doc/reference/datamodel.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1532,7 +1532,7 @@ returning an ordered dictionary.
15321532

15331533
The appropriate metaclass is determined by the following precedence rules:
15341534

1535-
* If the ``metaclass`` keyword argument is based with the bases, it is used.
1535+
* If the ``metaclass`` keyword argument is passed with the bases, it is used.
15361536

15371537
* Otherwise, if there is at least one base class, its metaclass is used.
15381538

Lib/turtle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
_tg_turtle_functions = ['back', 'backward', 'begin_fill', 'begin_poly', 'bk',
127127
'circle', 'clear', 'clearstamp', 'clearstamps', 'clone', 'color',
128128
'degrees', 'distance', 'dot', 'down', 'end_fill', 'end_poly', 'fd',
129-
'fillcolor', 'forward', 'get_poly', 'getpen', 'getscreen', 'get_shapepoly',
129+
'fillcolor', 'filling', 'forward', 'get_poly', 'getpen', 'getscreen', 'get_shapepoly',
130130
'getturtle', 'goto', 'heading', 'hideturtle', 'home', 'ht', 'isdown',
131131
'isvisible', 'left', 'lt', 'onclick', 'ondrag', 'onrelease', 'pd',
132132
'pen', 'pencolor', 'pendown', 'pensize', 'penup', 'pos', 'position',

0 commit comments

Comments
 (0)