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

Skip to content

Commit d98934c

Browse files
committed
Merged revisions 87101,87146,87156,87172,87175,87371,87378,87522-87524,87526-87528,87530-87536,87581 via svnmerge from
svn+ssh://svn.python.org/python/branches/py3k ........ r87101 | georg.brandl | 2010-12-06 23:02:48 +0100 (Mo, 06 Dez 2010) | 1 line Remove visible XXX comments. ........ r87146 | georg.brandl | 2010-12-09 19:08:43 +0100 (Do, 09 Dez 2010) | 1 line Fix "seperate". ........ r87156 | georg.brandl | 2010-12-10 11:01:44 +0100 (Fr, 10 Dez 2010) | 1 line #10668: fix wrong call of __init__. ........ r87172 | georg.brandl | 2010-12-11 20:10:30 +0100 (Sa, 11 Dez 2010) | 1 line Avoid AttributeError(_closed) when a TemporaryDirectory is deallocated whose mkdtemp call failed. ........ r87175 | georg.brandl | 2010-12-11 23:19:34 +0100 (Sa, 11 Dez 2010) | 1 line Fix markup. ........ r87371 | georg.brandl | 2010-12-18 17:21:58 +0100 (Sa, 18 Dez 2010) | 1 line Fix typo. ........ r87378 | georg.brandl | 2010-12-18 18:51:28 +0100 (Sa, 18 Dez 2010) | 1 line #10723: add missing builtin exceptions. ........ r87522 | georg.brandl | 2010-12-28 10:16:12 +0100 (Di, 28 Dez 2010) | 1 line Replace sys.maxint mention by sys.maxsize. ........ r87523 | georg.brandl | 2010-12-28 10:18:24 +0100 (Di, 28 Dez 2010) | 1 line Remove confusing paragraph -- this is relevant only to advanced users anyway and does not belong into the tutorial. ........ r87524 | georg.brandl | 2010-12-28 10:29:19 +0100 (Di, 28 Dez 2010) | 1 line Fix advice: call PyType_Ready to fill in ob_type of custom types. ........ r87526 | georg.brandl | 2010-12-28 11:38:33 +0100 (Di, 28 Dez 2010) | 1 line #10777: fix iteration over dict keys while mutating the dict. ........ r87527 | georg.brandl | 2010-12-28 11:56:20 +0100 (Di, 28 Dez 2010) | 1 line #10768: fix ScrolledText widget construction, and make the example work from the interactive shell. ........ r87528 | georg.brandl | 2010-12-28 12:02:12 +0100 (Di, 28 Dez 2010) | 1 line Add news entry and clarify another. ........ r87530 | georg.brandl | 2010-12-28 12:06:07 +0100 (Di, 28 Dez 2010) | 1 line #10767: update README in crashers; not all may have a bug entry and/or be fixed. ........ r87531 | georg.brandl | 2010-12-28 12:08:17 +0100 (Di, 28 Dez 2010) | 1 line #10742: document readonly attribute of memoryviews. ........ r87532 | georg.brandl | 2010-12-28 12:15:49 +0100 (Di, 28 Dez 2010) | 1 line #10781: clarify that *encoding* is not a parameter for Node objects in general. ........ r87533 | georg.brandl | 2010-12-28 12:38:12 +0100 (Di, 28 Dez 2010) | 1 line Remove history; adapt a bit more to reST, since this will once be part of the dev guide. ........ r87534 | georg.brandl | 2010-12-28 12:48:53 +0100 (Di, 28 Dez 2010) | 1 line Rewrap. ........ r87535 | georg.brandl | 2010-12-28 12:49:41 +0100 (Di, 28 Dez 2010) | 1 line #10739: document that on Windows, socket.makefile() does not make a file that has a true file descriptor usable where such a thing is expected. ........ r87536 | georg.brandl | 2010-12-28 12:53:25 +0100 (Di, 28 Dez 2010) | 1 line #10609: fix non-working dbm example. ........ r87581 | georg.brandl | 2010-12-30 18:36:17 +0100 (Do, 30 Dez 2010) | 1 line Fix NameErrors. ........
1 parent f6c8fd6 commit d98934c

16 files changed

Lines changed: 227 additions & 215 deletions

File tree

Doc/ACKS.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ [email protected]), and we'll be glad to correct the problem.
112112
* Andrew M. Kuchling
113113
* Dave Kuhlman
114114
* Erno Kuusela
115+
* Ross Lagerwall
115116
* Thomas Lamb
116117
* Detlef Lannert
117118
* Piers Lauder

Doc/c-api/slice.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,3 @@ Slice Objects
4848
normal slices.
4949

5050
Returns 0 on success and -1 on error with exception set.
51-

Doc/c-api/typeobj.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,9 @@ type objects) *must* have the :attr:`ob_size` field.
705705
This field is not inherited by subtypes (computed attributes are inherited
706706
through a different mechanism).
707707

708-
Docs for PyGetSetDef (XXX belong elsewhere)::
708+
.. XXX belongs elsewhere
709+
710+
Docs for PyGetSetDef::
709711

710712
typedef PyObject *(*getter)(PyObject *, void *);
711713
typedef int (*setter)(PyObject *, PyObject *, void *);
@@ -752,7 +754,7 @@ type objects) *must* have the :attr:`ob_size` field.
752754

753755
PyObject * tp_descr_get(PyObject *self, PyObject *obj, PyObject *type);
754756

755-
XXX explain.
757+
.. XXX explain.
756758
757759
This field is inherited by subtypes.
758760

@@ -767,7 +769,7 @@ type objects) *must* have the :attr:`ob_size` field.
767769

768770
This field is inherited by subtypes.
769771

770-
XXX explain.
772+
.. XXX explain.
771773
772774
773775
.. cmember:: long PyTypeObject.tp_dictoffset

Doc/extending/windows.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ described here are distributed with the Python sources in the
110110
Now your options are:
111111

112112
#. Copy :file:`example.sln` and :file:`example.vcproj`, rename them to
113-
:file:`spam.\*`, and edit them by hand, or
113+
:file:`spam.\*`, and edit them by hand, or
114114

115115
#. Create a brand new project; instructions are below.
116116

@@ -179,8 +179,8 @@ constant". This shows up when building DLL under MSVC. Change it to::
179179

180180
and add the following to the module initialization function::
181181

182-
MyObject_Type.ob_type = &PyType_Type;
183-
182+
if (PyType_Ready(&MyObject_Type) < 0)
183+
return NULL;
184184

185185

186186
.. _dynamic-linking:

Doc/glossary.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -179,22 +179,22 @@ Glossary
179179
not expressions.
180180

181181
extension module
182-
A module written in C or C++, using Python's C API to interact with the core and
183-
with user code.
182+
A module written in C or C++, using Python's C API to interact with the
183+
core and with user code.
184184

185185
file object
186186
An object exposing a file-oriented API (with methods such as
187-
:meth:`read()` or :meth:`write()`) to an underlying resource.
188-
Depending on the way it was created, a file object can mediate access
189-
to a real on-disk file or to another other type of storage or
190-
communication device (for example standard input/output, in-memory
191-
buffers, sockets, pipes, etc.). File objects are also called
192-
:dfn:`file-like objects` or :dfn:`streams`.
193-
194-
There are actually three categories of file objects: raw binary
195-
files, buffered binary files and text files. Their interfaces are
196-
defined in the :mod:`io` module. The canonical way to create a
197-
file object is by using the :func:`open` function.
187+
:meth:`read()` or :meth:`write()`) to an underlying resource. Depending
188+
on the way it was created, a file object can mediate access to a real
189+
on-disk file or to another other type of storage or communication device
190+
(for example standard input/output, in-memory buffers, sockets, pipes,
191+
etc.). File objects are also called :dfn:`file-like objects` or
192+
:dfn:`streams`.
193+
194+
There are actually three categories of file objects: raw binary files,
195+
buffered binary files and text files. Their interfaces are defined in the
196+
:mod:`io` module. The canonical way to create a file object is by using
197+
the :func:`open` function.
198198

199199
file-like object
200200
A synonym for :term:`file object`.

Doc/library/collections.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,7 @@ If a new entry overwrites an existing entry, the
810810
original insertion position is changed and moved to the end::
811811

812812
class LastUpdatedOrderedDict(OrderedDict):
813-
'Store items is the order the keys were last added'
813+
'Store items in the order the keys were last added'
814814
def __setitem__(self, key, value):
815815
if key in self:
816816
del self[key]

Doc/library/dbm.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,8 @@ then prints out the contents of the database::
8686
# Notice how the value is now in bytes.
8787
assert db['www.cnn.com'] == b'Cable News Network'
8888

89-
# Loop through contents. Other dictionary methods
90-
# such as .keys(), .values() also work.
91-
for k, v in db.iteritems():
92-
print(k, '\t', v)
89+
# Often-used methods of the dict interface work too.
90+
print(db.get('python.org', b'not present'))
9391

9492
# Storing a non-string key or value will raise an exception (most
9593
# likely a TypeError).

Doc/library/exceptions.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ The following exceptions are used mostly as base classes for other exceptions.
7777
:exc:`FloatingPointError`.
7878

7979

80+
.. exception:: BufferError
81+
82+
Raised when a :ref:`buffer <bufferobjects>` related operation cannot be
83+
performed.
84+
85+
8086
.. exception:: LookupError
8187

8288
The base class for the exceptions that are raised when a key or index used on
@@ -271,6 +277,18 @@ The following exceptions are the exceptions that are usually raised.
271277
of the exception instance returns only the message.
272278

273279

280+
.. exception:: IndentationError
281+
282+
Base class for syntax errors related to incorrect indentation. This is a
283+
subclass of :exc:`SyntaxError`.
284+
285+
286+
.. exception:: TabError
287+
288+
Raised when indentation contains an inconsistent use of tabs and spaces.
289+
This is a subclass of :exc:`IndentationError`.
290+
291+
274292
.. exception:: SystemError
275293

276294
Raised when the interpreter finds an internal error, but the situation does not

Doc/library/socket.rst

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -616,16 +616,21 @@ correspond to Unix system calls applicable to sockets.
616616

617617
.. index:: single: I/O control; buffering
618618

619-
Return a :term:`file object` associated with the socket. The exact
620-
returned type depends on the arguments given to :meth:`makefile`. These
621-
arguments are interpreted the same way as by the built-in :func:`open`
622-
function.
619+
Return a :term:`file object` associated with the socket. The exact returned
620+
type depends on the arguments given to :meth:`makefile`. These arguments are
621+
interpreted the same way as by the built-in :func:`open` function.
623622

624623
Closing the file object won't close the socket unless there are no remaining
625624
references to the socket. The socket must be in blocking mode; it can have
626625
a timeout, but the file object's internal buffer may end up in a inconsistent
627626
state if a timeout occurs.
628627

628+
.. note::
629+
630+
On Windows, the file-like object created by :meth:`makefile` cannot be
631+
used where a file object with a file descriptor is expected, such as the
632+
stream arguments of :meth:`subprocess.Popen`.
633+
629634

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

Doc/library/stdtypes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2203,6 +2203,10 @@ copying. Memory is generally interpreted as simple bytes.
22032203
A tuple of integers the length of :attr:`ndim` giving the size in bytes to
22042204
access each element for each dimension of the array.
22052205

2206+
.. attribute:: readonly
2207+
2208+
A bool indicating whether the memory is read only.
2209+
22062210
.. memoryview.suboffsets isn't documented because it only seems useful for C
22072211
22082212

0 commit comments

Comments
 (0)