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

Skip to content

Commit 81ac1ce

Browse files
committed
Address a few XXX comments, other fixes.
1 parent dcc56f8 commit 81ac1ce

20 files changed

Lines changed: 43 additions & 124 deletions

Doc/TODO.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ To do
44
* split very large files and add toctrees
55
* finish "Documenting Python"
66
* care about XXX comments
7+
* X-refs to statements

Doc/c-api/newtypes.rst

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,7 +1155,7 @@ The next fields, up to and including :attr:`tp_weaklist`, only exist if the
11551155

11561156
PyObject * tp_descr_get(PyObject *self, PyObject *obj, PyObject *type);
11571157

1158-
XXX blah, blah.
1158+
XXX more
11591159

11601160
This field is inherited by subtypes.
11611161

@@ -1170,7 +1170,7 @@ The next fields, up to and including :attr:`tp_weaklist`, only exist if the
11701170

11711171
This field is inherited by subtypes.
11721172

1173-
XXX blah, blah.
1173+
XXX more
11741174

11751175

11761176
.. cmember:: long PyTypeObject.tp_dictoffset
@@ -1595,9 +1595,6 @@ objects which may also be containers. Types which do not store references to
15951595
other objects, or which only store references to atomic types (such as numbers
15961596
or strings), do not need to provide any explicit support for garbage collection.
15971597

1598-
.. An example showing the use of these interfaces can be found in "Supporting the
1599-
.. Cycle Collector (XXX not found: ../ext/example-cycle-support.html)".
1600-
16011598
To create a container type, the :attr:`tp_flags` field of the type object must
16021599
include the :const:`Py_TPFLAGS_HAVE_GC` and provide an implementation of the
16031600
:attr:`tp_traverse` handler. If instances of the type are mutable, a

Doc/extending/newtypes.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,6 @@ at a shell should produce a file :file:`noddy.so` in a subdirectory; move to
232232
that directory and fire up Python --- you should be able to ``import noddy`` and
233233
play around with Noddy objects.
234234

235-
.. % $ <-- bow to font-lock ;-(
236-
237235
That wasn't so hard, was it?
238236

239237
Of course, the current Noddy type is pretty uninteresting. It has no data and

Doc/install/index.rst

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -517,11 +517,7 @@ might define the following installation scheme::
517517
--install-scripts=python/scripts
518518
--install-data=python/data
519519

520-
or, equivalently,
521-
522-
.. % $ % -- bow to font-lock
523-
524-
::
520+
or, equivalently, ::
525521

526522
python setup.py install --home=~/python \
527523
--install-purelib=lib \
@@ -533,8 +529,6 @@ or, equivalently,
533529
the Distutils as it parses your command line options, just as it does when
534530
parsing your configuration file(s).
535531

536-
.. % $ % -- bow to font-lock
537-
538532
Obviously, specifying the entire installation scheme every time you install a
539533
new module distribution would be very tedious. Thus, you can put these options
540534
into your Distutils config file (see section :ref:`inst-config-files`)::

Doc/library/curses.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1170,7 +1170,6 @@ Several constants are available to specify character cell attributes:
11701170
Keys are referred to by integer constants with names starting with ``KEY_``.
11711171
The exact keycaps available are system dependent.
11721172

1173-
.. % XXX this table is far too large!
11741173
.. % XXX should this table be alphabetized?
11751174
11761175
+-------------------+--------------------------------------------+

Doc/library/exceptions.rst

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,9 @@ The following exceptions are the exceptions that are actually raised.
126126
127127
.. exception:: EOFError
128128

129-
Raised when attempting to read beyond the end of a file. (N.B.: the :meth:`read`
130-
and :meth:`readline` methods of file objects return an empty string when they
131-
hit EOF.)
132-
133-
.. % XXXJH xrefs here
134-
.. % XXXJH xrefs here
129+
Raised when attempting to read beyond the end of a file. (N.B.: the
130+
:meth:`file.read` and :meth:`file.readline` methods return an empty string
131+
when they hit EOF.)
135132

136133

137134
.. exception:: FloatingPointError
@@ -154,12 +151,10 @@ The following exceptions are the exceptions that are actually raised.
154151

155152
.. exception:: IOError
156153

157-
Raised when an I/O operation (such as a :keyword:`print` statement, the built-in
158-
:func:`open` function or a method of a file object) fails for an I/O-related
154+
Raised when an I/O operation (such as the built-in :func:`print` or
155+
:func:`open` functions or a method of a file object) fails for an I/O-related
159156
reason, e.g., "file not found" or "disk full".
160157

161-
.. % XXXJH xrefs here
162-
163158
This class is derived from :exc:`EnvironmentError`. See the discussion above
164159
for more information on exception instance attributes.
165160

@@ -169,8 +164,6 @@ The following exceptions are the exceptions that are actually raised.
169164
Raised when an :keyword:`import` statement fails to find the module definition
170165
or when a ``from ... import`` fails to find a name that is to be imported.
171166

172-
.. % XXXJH xref to import statement?
173-
174167

175168
.. exception:: IndexError
176169

@@ -191,12 +184,10 @@ The following exceptions are the exceptions that are actually raised.
191184
.. exception:: KeyboardInterrupt
192185

193186
Raised when the user hits the interrupt key (normally :kbd:`Control-C` or
194-
:kbd:`Delete`). During execution, a check for interrupts is made regularly. The
195-
exception inherits from :exc:`BaseException` so as to not be accidentally caught
196-
by code that catches :exc:`Exception` and thus prevent the interpreter from
197-
exiting.
198-
199-
.. % XXX(hylton) xrefs here
187+
:kbd:`Delete`). During execution, a check for interrupts is made
188+
regularly. The exception inherits from :exc:`BaseException` so as to not be
189+
accidentally caught by code that catches :exc:`Exception` and thus prevent
190+
the interpreter from exiting.
200191

201192
.. versionchanged:: 2.5
202193
Changed to inherit from :exc:`BaseException`.
@@ -246,11 +237,7 @@ The following exceptions are the exceptions that are actually raised.
246237
represented. This cannot occur for long integers (which would rather raise
247238
:exc:`MemoryError` than give up). Because of the lack of standardization of
248239
floating point exception handling in C, most floating point operations also
249-
aren't checked. For plain integers, all operations that can overflow are
250-
checked except left shift, where typical applications prefer to drop bits than
251-
raise an exception.
252-
253-
.. % XXXJH reference to long's and/or int's?
240+
aren't checked.
254241

255242

256243
.. exception:: ReferenceError
@@ -290,8 +277,6 @@ The following exceptions are the exceptions that are actually raised.
290277
or :func:`eval`, or when reading the initial script or standard input
291278
(also interactively).
292279

293-
.. % XXXJH xref to these functions?
294-
295280
Instances of this class have attributes :attr:`filename`, :attr:`lineno`,
296281
:attr:`offset` and :attr:`text` for easier access to the details. :func:`str`
297282
of the exception instance returns only the message.
@@ -319,8 +304,6 @@ The following exceptions are the exceptions that are actually raised.
319304
it has another type (such as a string), the object's value is printed and the
320305
exit status is one.
321306

322-
.. % XXX(hylton) xref to module sys?
323-
324307
Instances have an attribute :attr:`code` which is set to the proposed exit
325308
status or error message (defaulting to ``None``). Also, this exception derives
326309
directly from :exc:`BaseException` and not :exc:`Exception`, since it is not

Doc/library/getopt.rst

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@
99

1010
This module helps scripts to parse the command line arguments in ``sys.argv``.
1111
It supports the same conventions as the Unix :cfunc:`getopt` function (including
12-
the special meanings of arguments of the form '``-``' and '``-``\ ``-``'). Long
12+
the special meanings of arguments of the form '``-``' and '``--``'). Long
1313
options similar to those supported by GNU software may be used as well via an
1414
optional third argument. This module provides a single function and an
1515
exception:
1616

17-
.. % That's to fool latex2html into leaving the two hyphens alone!
18-
1917

2018
.. function:: getopt(args, options[, long_options])
2119

@@ -32,7 +30,7 @@ exception:
3230
work.
3331

3432
*long_options*, if specified, must be a list of strings with the names of the
35-
long options which should be supported. The leading ``'-``\ ``-'`` characters
33+
long options which should be supported. The leading ``'--'`` characters
3634
should not be included in the option name. Long options which require an
3735
argument should be followed by an equal sign (``'='``). To accept only long
3836
options, *options* should be an empty string. Long options on the command line
@@ -46,7 +44,7 @@ exception:
4644
option list was stripped (this is a trailing slice of *args*). Each
4745
option-and-value pair returned has the option as its first element, prefixed
4846
with a hyphen for short options (e.g., ``'-x'``) or two hyphens for long
49-
options (e.g., ``'-``\ ``-long-option'``), and the option argument as its
47+
options (e.g., ``'--long-option'``), and the option argument as its
5048
second element, or an empty string if the option has no argument. The
5149
options occur in the list in the same order in which they were found, thus
5250
allowing multiple occurrences. Long and short options may be mixed.

Doc/library/logging.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ This time, all messages with a severity of DEBUG or above were handled, and the
611611
format of the messages was also changed, and output went to the specified file
612612
rather than the console.
613613

614-
.. XXX logging should probably be updated!
614+
.. XXX logging should probably be updated for new string formatting!
615615
616616
Formatting uses the old Python string formatting - see section
617617
:ref:`old-string-formatting`. The format string takes the following common

Doc/library/new.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ The :mod:`new` module defines the following functions:
3737

3838
This function is an interface to the :cfunc:`PyCode_New` C function.
3939

40-
.. % XXX This is still undocumented!!!!!!!!!!!
40+
.. XXX This is still undocumented!!!
4141
4242
4343
.. function:: module(name[, doc])

Doc/library/nntplib.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ indicates an error, the method raises one of the above exceptions.
316316
is supplied, then the returned *list* is an empty list. This is an optional NNTP
317317
extension, and may not be supported by all servers.
318318

319-
.. % XXX huh? Should that be name, description?
319+
.. % XXX huh? Should that be (name, description)?
320320
321321
RFC2980 says "It is suggested that this extension be deprecated". Use
322322
:meth:`descriptions` or :meth:`description` instead.

0 commit comments

Comments
 (0)