Commit c37b65ee authored by Fred Drake's avatar Fred Drake

Clean up some markup cruft. A number of the macros that take no

parameters (like \UNIX) are commonly entered using an empty group to
separate the markup from a following inter-word space; this is not
needed when the next character is punctuation, or the markup is the
last thing in the enclosing group.  These cases were marked
inconsistently; the empty group is now *only* used when needed.
parent 00859c05
......@@ -736,14 +736,14 @@ determination.
\begin{cfuncdesc}{PyObject*}{PySequence_Fast_GET_ITEM}{PyObject *o, int i}
Return the \var{i}th element of \var{o}, assuming that \var{o} was
returned by \cfunction{PySequence_Fast()}, \var{o} is not \NULL{},
returned by \cfunction{PySequence_Fast()}, \var{o} is not \NULL,
and that \var{i} is within bounds.
\end{cfuncdesc}
\begin{cfuncdesc}{int}{PySequence_Fast_GET_SIZE}{PyObject *o}
Returns the length of \var{o}, assuming that \var{o} was
returned by \cfunction{PySequence_Fast()} and that \var{o} is
not \NULL{}. The size can also be gotten by calling
not \NULL. The size can also be gotten by calling
\cfunction{PySequence_Size()} on \var{o}, but
\cfunction{PySequence_Fast_GET_SIZE()} is faster because it can
assume \var{o} is a list or tuple.
......
......@@ -3,7 +3,7 @@
The Application Programmer's Interface to Python gives C and
\Cpp{} programmers access to the Python interpreter at a variety of
levels. The API is equally usable from \Cpp{}, but for brevity it is
levels. The API is equally usable from \Cpp, but for brevity it is
generally referred to as the Python/C API. There are two
fundamentally different reasons for using the Python/C API. The first
reason is to write \emph{extension modules} for specific purposes;
......
......@@ -272,14 +272,14 @@ application to Python.
% (what to watch out for)
\section{Embedding Python in \Cpp{}
\section{Embedding Python in \Cpp
\label{embeddingInCplusplus}}
It is also possible to embed Python in a \Cpp{} program; precisely how this
is done will depend on the details of the \Cpp{} system used; in general you
will need to write the main program in \Cpp{}, and use the \Cpp{} compiler
will need to write the main program in \Cpp, and use the \Cpp{} compiler
to compile and link your program. There is no need to recompile Python
itself using \Cpp{}.
itself using \Cpp.
\section{Linking Requirements
......
\chapter{Extending Python with C or \Cpp{} \label{intro}}
\chapter{Extending Python with C or \Cpp \label{intro}}
It is quite easy to add new built-in modules to Python, if you know
......@@ -499,14 +499,14 @@ This function must be registered with the interpreter using the
\constant{METH_VARARGS} flag; this is described in section
\ref{methodTable}, ``The Module's Method Table and Initialization
Function.'' The \cfunction{PyArg_ParseTuple()} function and its
arguments are documented in section \ref{parseTuple}, ``Extracting
arguments are documented in section~\ref{parseTuple}, ``Extracting
Parameters in Extension Functions.''
The macros \cfunction{Py_XINCREF()} and \cfunction{Py_XDECREF()}
increment/decrement the reference count of an object and are safe in
the presence of \NULL{} pointers (but note that \var{temp} will not be
\NULL{} in this context). More info on them in section
\ref{refcounts}, ``Reference Counts.''
\NULL{} in this context). More info on them in
section~\ref{refcounts}, ``Reference Counts.''
Later, when it is time to call the function, you call the C function
\cfunction{PyEval_CallObject()}. This function has two arguments, both
......@@ -544,7 +544,7 @@ global variable, you should somehow \cfunction{Py_DECREF()} the result,
even (especially!) if you are not interested in its value.
Before you do this, however, it is important to check that the return
value isn't \NULL{}. If it is, the Python function terminated by
value isn't \NULL. If it is, the Python function terminated by
raising an exception. If the C code that called
\cfunction{PyEval_CallObject()} is called from Python, it should now
return an error indication to its Python caller, so the interpreter
......@@ -652,7 +652,7 @@ representation.
\item[\samp{z} (string or \code{None}) {[char *]}]
Like \samp{s}, but the Python object may also be \code{None}, in which
case the C pointer is set to \NULL{}.
case the C pointer is set to \NULL.
\item[\samp{z\#} (string or \code{None} or any read buffer compatible object)
{[char *, int]}]
......@@ -680,7 +680,7 @@ first one a pointer to an encoding name string (\var{encoding}), and the
second a pointer to a pointer to a character buffer (\var{**buffer},
the buffer used for storing the encoded data).
The encoding name must map to a registered codec. If set to \NULL{},
The encoding name must map to a registered codec. If set to \NULL,
the default encoding is used.
\cfunction{PyArg_ParseTuple()} will allocate a buffer of the needed
......@@ -705,7 +705,7 @@ pointer to a character buffer (\var{**buffer}, the buffer used for
storing the encoded data) and the third one a pointer to an integer
(\var{*buffer_length}, the buffer length).
The encoding name must map to a registered codec. If set to \NULL{},
The encoding name must map to a registered codec. If set to \NULL,
the default encoding is used.
There are two modes of operation:
......@@ -766,7 +766,7 @@ Convert a Python complex number to a C \ctype{Py_complex} structure.
Store a Python object (without any conversion) in a C object pointer.
The C program thus receives the actual object that was passed. The
object's reference count is not increased. The pointer stored is not
\NULL{}.
\NULL.
\item[\samp{O!} (object) {[\var{typeobject}, PyObject *]}]
Store a Python object in a C object pointer. This is similar to
......@@ -945,7 +945,7 @@ int PyArg_ParseTupleAndKeywords(PyObject *arg, PyObject *kwdict,
The \var{arg} and \var{format} parameters are identical to those of the
\cfunction{PyArg_ParseTuple()} function. The \var{kwdict} parameter
is the dictionary of keywords received as the third parameter from the
Python runtime. The \var{kwlist} parameter is a \NULL{}-terminated
Python runtime. The \var{kwlist} parameter is a \NULL-terminated
list of strings which identify the parameters; the names are matched
with the type information from \var{format} from left to right. On
success, \cfunction{PyArg_ParseTupleAndKeywords()} returns true,
......@@ -1055,11 +1055,11 @@ used to make long format strings a tad more readable.
\item[\samp{s} (string) {[char *]}]
Convert a null-terminated C string to a Python object. If the C
string pointer is \NULL{}, \code{None} is used.
string pointer is \NULL, \code{None} is used.
\item[\samp{s\#} (string) {[char *, int]}]
Convert a C string and its length to a Python object. If the C string
pointer is \NULL{}, the length is ignored and \code{None} is
pointer is \NULL, the length is ignored and \code{None} is
returned.
\item[\samp{z} (string or \code{None}) {[char *]}]
......@@ -1171,10 +1171,10 @@ Examples (to the left the call, to the right the resulting Python value):
\section{Reference Counts
\label{refcounts}}
In languages like C or \Cpp{}, the programmer is responsible for
In languages like C or \Cpp, the programmer is responsible for
dynamic allocation and deallocation of memory on the heap. In C,
this is done using the functions \cfunction{malloc()} and
\cfunction{free()}. In \Cpp{}, the operators \keyword{new} and
\cfunction{free()}. In \Cpp, the operators \keyword{new} and
\keyword{delete} are used with essentially the same meaning; they are
actually implemented using \cfunction{malloc()} and
\cfunction{free()}, so we'll restrict the following discussion to the
......@@ -1423,7 +1423,7 @@ cause later core dumps) if you do so. Functions that return object
references generally return \NULL{} only to indicate that an
exception occurred. The reason for not testing for \NULL{}
arguments is that functions often pass the objects they receive on to
other function --- if each function were to test for \NULL{},
other function --- if each function were to test for \NULL,
there would be a lot of redundant tests and the code would run more
slowly.
......@@ -1458,10 +1458,10 @@ the Python user.
% description.
\section{Writing Extensions in \Cpp{}
\section{Writing Extensions in \Cpp
\label{cplusplus}}
It is possible to write extension modules in \Cpp{}. Some restrictions
It is possible to write extension modules in \Cpp. Some restrictions
apply. If the main program (the Python interpreter) is compiled and
linked by the C compiler, global or static objects with constructors
cannot be used. This is not a problem if the main program is linked
......
......@@ -13,7 +13,7 @@ custom interpreters. The make file make file builds a make file
that reflects various system variables determined by configure when
the Python interpreter was built, so people building module's don't
have to resupply these settings. This vastly simplifies the process
of building extensions and custom interpreters on Unix systems.
of building extensions and custom interpreters on \UNIX{} systems.
The make file make file is distributed as the file
\file{Misc/Makefile.pre.in} in the Python source distribution. The
......
......@@ -3,7 +3,7 @@
This chapter briefly explains how to create a Windows extension module
for Python using Microsoft Visual \Cpp{}, and follows with more
for Python using Microsoft Visual \Cpp, and follows with more
detailed background information on how it works. The explanatory
material is useful for both the Windows programmer learning to build
Python extensions and the \UNIX{} programmer interested in producing
......@@ -66,7 +66,7 @@ on why you must do this.
loading of code. Before you try to build a module that can be
dynamically loaded, be aware of how your system works.
In \UNIX{}, a shared object (\file{.so}) file contains code to be used by the
In \UNIX, a shared object (\file{.so}) file contains code to be used by the
program, and also the names of functions and data that it expects to
find in the program. When the file is joined to the program, all
references to those functions and data in the file's code are changed
......@@ -80,7 +80,7 @@ to refer to the program's memory; instead, the code already uses the
DLL's lookup table, and the lookup table is modified at runtime to
point to the functions and data.
In \UNIX{}, there is only one type of library file (\file{.a}) which
In \UNIX, there is only one type of library file (\file{.a}) which
contains code from several object files (\file{.o}). During the link
step to create a shared object file (\file{.so}), the linker may find
that it doesn't know where an identifier is defined. The linker will
......@@ -99,7 +99,7 @@ an import library may be generated, which will need to be used for all
future DLLs that depend on the symbols in the application or DLL.
Suppose you are building two dynamic-load modules, B and C, which should
share another block of code A. On \UNIX{}, you would \emph{not} pass
share another block of code A. On \UNIX, you would \emph{not} pass
\file{A.a} to the linker for \file{B.so} and \file{C.so}; that would
cause it to be included twice, so that B and C would each have their
own copy. In Windows, building \file{A.dll} will also build
......@@ -109,14 +109,14 @@ which will be used at runtime to access A's code.
In Windows, using an import library is sort of like using \samp{import
spam}; it gives you access to spam's names, but does not create a
separate copy. On \UNIX{}, linking with a library is more like
separate copy. On \UNIX, linking with a library is more like
\samp{from spam import *}; it does create a separate copy.
\section{Using DLLs in Practice \label{win-dlls}}
\sectionauthor{Chris Phoenix}{cphoenix@best.com}
Windows Python is built in Microsoft Visual \Cpp{}; using other
Windows Python is built in Microsoft Visual \Cpp; using other
compilers may or may not work (though Borland seems to). The rest of
this section is MSV\Cpp{} specific.
......
......@@ -123,7 +123,7 @@ Returns the standard info string of the object.
\end{funcdesc}
\begin{funcdesc}{tod_gettime}{}
Returns the time (in seconds since the Epoch, in UCT, as for \POSIX{}) from
Returns the time (in seconds since the Epoch, in UCT, as for \POSIX) from
a time server.
\end{funcdesc}
......
......@@ -56,7 +56,7 @@ newline (\code{'\e n'}), a newline will be added. This causes
\begin{seealso}
\seemodule{binascii}{Support module containing \ASCII{}-to-binary
\seemodule{binascii}{Support module containing \ASCII-to-binary
and binary-to-\ASCII{} conversions.}
\seerfc{1521}{MIME (Multipurpose Internet Mail Extensions) Part One:
Mechanisms for Specifying and Describing the Format of
......
\section{\module{binascii} ---
Convert between binary and \ASCII{}}
Convert between binary and \ASCII}
\declaremodule{builtin}{binascii}
\modulesynopsis{Tools for converting between binary and various
......@@ -7,7 +7,7 @@
The \module{binascii} module contains a number of methods to convert
between binary and various \ASCII{}-encoded binary
between binary and various \ASCII-encoded binary
representations. Normally, you will not use these functions directly
but use wrapper modules like \refmodule{uu}\refstmodindex{uu} or
\refmodule{binhex}\refstmodindex{binhex} instead, this module solely
......
......@@ -6,7 +6,7 @@
This module encodes and decodes files in binhex4 format, a format
allowing representation of Macintosh files in \ASCII{}. On the Macintosh,
allowing representation of Macintosh files in \ASCII. On the Macintosh,
both forks of a file and the finder information are encoded (or
decoded), on other platforms only the data fork is handled.
......
......@@ -86,7 +86,7 @@ be generated is platform-dependent.
\begin{funcdesc}{timegm}{tuple}
An unrelated but handy function that takes a time tuple such as
returned by the \function{gmtime()} function in the \refmodule{time}
module, and returns the corresponding Unix timestamp value, assuming
module, and returns the corresponding \UNIX{} timestamp value, assuming
an epoch of 1970, and the POSIX encoding. In fact,
\function{time.gmtime()} and \function{timegm()} are each others' inverse.
\end{funcdesc}
......
......@@ -405,7 +405,7 @@ to a shell command, you should make sure the string contains only
alphanumeric characters, dashes, underscores, and periods.
\subsection{Installing your CGI script on a Unix system}
\subsection{Installing your CGI script on a \UNIX\ system}
Read the documentation for your HTTP server and check with your local
system administrator to find the directory where CGI scripts should be
......
......@@ -150,7 +150,7 @@ De-initialize the library, and return terminal to normal status.
\end{funcdesc}
\begin{funcdesc}{erasechar}{}
Returns the user's current erase character. Under Unix operating
Returns the user's current erase character. Under \UNIX{} operating
systems this is a property of the controlling tty of the curses
program, and is not set by the curses library itself.
\end{funcdesc}
......@@ -284,7 +284,7 @@ prefix `M-' followed by the name of the corresponding ASCII character.
\end{funcdesc}
\begin{funcdesc}{killchar}{}
Returns the user's current line kill character. Under Unix operating
Returns the user's current line kill character. Under \UNIX{} operating
systems this is a property of the controlling tty of the curses
program, and is not set by the curses library itself.
\end{funcdesc}
......
......@@ -87,7 +87,7 @@ is useful in code like:
Call the function named \var{name} in the referenced shared object.
The arguments must be either Python integers, which will be
passed as is, Python strings, to which a pointer will be passed,
or \code{None}, which will be passed as \NULL{}. Note that
or \code{None}, which will be passed as \NULL. Note that
strings should only be passed to functions as \ctype{const char*}, as
Python will not like its string mutated.
......
......@@ -136,11 +136,11 @@ Raised when an \keyword{assert} statement fails.
\begin{excdesc}{EOFError}
% XXXJH xrefs here
Raised when one of the built-in functions (\function{input()} or
\function{raw_input()}) hits an end-of-file condition (\EOF{}) without
\function{raw_input()}) hits an end-of-file condition (\EOF) without
reading any data.
% XXXJH xrefs here
(N.B.: the \method{read()} and \method{readline()} methods of file
objects return an empty string when they hit \EOF{}.)
objects return an empty string when they hit \EOF.)
\end{excdesc}
\begin{excdesc}{FloatingPointError}
......
......@@ -6,8 +6,8 @@
\modulesynopsis{The \function{fcntl()} and \function{ioctl()} system calls.}
\sectionauthor{Jaap Vermeulen}{}
\indexii{UNIX@\UNIX{}}{file control}
\indexii{UNIX@\UNIX{}}{I/O control}
\indexii{UNIX@\UNIX}{file control}
\indexii{UNIX@\UNIX}{I/O control}
This module performs file control and I/O control on file descriptors.
It is an interface to the \cfunction{fcntl()} and \cfunction{ioctl()}
......
......@@ -19,7 +19,7 @@ characters used in shell-style wildcards are:
\lineii{[!\var{seq}]}{matches any character not in \var{seq}}
\end{tableii}
Note that the filename separator (\code{'/'} on \UNIX{}) is \emph{not}
Note that the filename separator (\code{'/'} on \UNIX) is \emph{not}
special to this module. See module
\refmodule{glob}\refstmodindex{glob} for pathname expansion
(\refmodule{glob} uses \function{fnmatch()} to match pathname
......
......@@ -15,13 +15,13 @@ The \module{getpass} module provides two functions:
Prompt the user for a password without echoing. The user is
prompted using the string \var{prompt}, which defaults to
\code{'Password: '}.
Availability: Macintosh, \UNIX{}, Windows.
Availability: Macintosh, \UNIX, Windows.
\end{funcdesc}
\begin{funcdesc}{getuser}{}
Return the ``login name'' of the user.
Availability: \UNIX{}, Windows.
Availability: \UNIX, Windows.
This function checks the environment variables \envvar{LOGNAME},
\envvar{USER}, \envvar{LNAME} and \envvar{USERNAME}, in order, and
......
......@@ -6,7 +6,7 @@
This module defines a number of classes that allow easy and uniform
access to mail messages in a (\UNIX{}) mailbox.
access to mail messages in a (\UNIX) mailbox.
\begin{classdesc}{UnixMailbox}{fp\optional{, factory}}
Access to a classic \UNIX-style mailbox, where all messages are
......
......@@ -2,7 +2,7 @@
Memory-mapped file support}
\declaremodule{builtin}{mmap}
\modulesynopsis{Interface to memory-mapped files for Unix and Windows.}
\modulesynopsis{Interface to memory-mapped files for \UNIX\ and Windows.}
Memory-mapped file objects behave like both mutable strings and like
file objects. You can use mmap objects in most places where strings
......
This diff is collapsed.
......@@ -13,7 +13,7 @@ disguised \UNIX{} interface).
\strong{Do not import this module directly.} Instead, import the
module \refmodule{os}, which provides a \emph{portable} version of this
interface. On \UNIX{}, the \refmodule{os} module provides a superset of
interface. On \UNIX, the \refmodule{os} module provides a superset of
the \module{posix} interface. On non-\UNIX{} operating systems the
\module{posix} module is not available, but a subset is always
available through the \refmodule{os} interface. Once \refmodule{os} is
......
......@@ -9,7 +9,7 @@
\sectionauthor{Jaap Vermeulen}{}
\indexii{\POSIX{}}{file object}
\indexii{\POSIX}{file object}
\deprecated{1.5}{The locking operation that this module provides is
done better and more portably by the
......@@ -22,7 +22,7 @@ the file flags, and an easy interface to duplicate the file object.
The module defines a new file object, the posixfile object. It
has all the standard file object methods and adds the methods
described below. This module only works for certain flavors of
\UNIX{}, since it uses \function{fcntl.fcntl()} for file locking.%
\UNIX, since it uses \function{fcntl.fcntl()} for file locking.%
\withsubitem{(in module fcntl)}{\ttindex{fcntl()}}
To instantiate a posixfile object, use the \function{open()} function
......
......@@ -127,7 +127,7 @@ inserted between components, unless \var{path} is empty.
\end{funcdesc}
\begin{funcdesc}{normcase}{path}
Normalize the case of a pathname. On \UNIX{}, this returns the path
Normalize the case of a pathname. On \UNIX, this returns the path
unchanged; on case-insensitive filesystems, it converts the path to
lowercase. On Windows, it also converts forward slashes to backward
slashes.
......@@ -144,7 +144,7 @@ forward slashes to backward slashes.
\begin{funcdesc}{realpath}{path}
Return the canonical path of the specified filename, eliminating any
symbolic links encountered in the path.
Availability: \UNIX{}.
Availability: \UNIX.
\versionadded{2.2}
\end{funcdesc}
......@@ -153,14 +153,14 @@ Return true if both pathname arguments refer to the same file or
directory (as indicated by device number and i-node number).
Raise an exception if a \function{os.stat()} call on either pathname
fails.
Availability: Macintosh, \UNIX{}.
Availability: Macintosh, \UNIX.
\end{funcdesc}
\begin{funcdesc}{sameopenfile}{fp1, fp2}
Return true if the file objects \var{fp1} and \var{fp2} refer to the
same file. The two file objects may represent different file
descriptors.
Availability: Macintosh, \UNIX{}.
Availability: Macintosh, \UNIX.
\end{funcdesc}
\begin{funcdesc}{samestat}{stat1, stat2}
......@@ -169,7 +169,7 @@ the same file. These structures may have been returned by
\function{fstat()}, \function{lstat()}, or \function{stat()}. This
function implements the underlying comparison used by
\function{samefile()} and \function{sameopenfile()}.
Availability: Macintosh, \UNIX{}.
Availability: Macintosh, \UNIX.
\end{funcdesc}
\begin{funcdesc}{split}{path}
......
......@@ -9,7 +9,7 @@ This module provides access to the \cfunction{select()}
and \cfunction{poll()} functions
available in most operating systems. Note that on Windows, it only
works for sockets; on other operating systems, it also works for other
file types (in particular, on \UNIX{}, it works on pipes). It cannot
file types (in particular, on \UNIX, it works on pipes). It cannot
be used on regular files to determine whether a file has grown since
it was last read.
......@@ -67,7 +67,7 @@ desciptors that don't originate from WinSock.}
\subsection{Polling Objects
\label{poll-objects}}
The \cfunction{poll()} system call, supported on most Unix systems,
The \cfunction{poll()} system call, supported on most \UNIX{} systems,
provides better scalability for network servers that service many,
many clients at the same time.
\cfunction{poll()} scales better because the system call only
......
......@@ -20,7 +20,7 @@ tail part. For the head part, it uses \code{sys.prefix} and
\code{sys.exec_prefix}; empty heads are skipped. For
the tail part, it uses the empty string (on Macintosh or Windows) or
it uses first \file{lib/python\shortversion/site-packages} and then
\file{lib/site-python} (on \UNIX{}). For each of the distinct
\file{lib/site-python} (on \UNIX). For each of the distinct
head-tail combinations, it sees if it refers to an existing directory,
and if so, adds to \code{sys.path}, and also inspects the path for
configuration files.
......
......@@ -115,10 +115,10 @@ Time of last status change (see manual pages for details).
The interpretation of ``file size'' changes according to the file
type. For plain files this is the size of the file in bytes. For
FIFOs and sockets under most Unixes (including Linux in particular),
the ``size'' is the number of bytes waiting to be read at the time of
the call to \function{os.stat()}, \function{os.fstat()}, or
\function{os.lstat()}; this can sometimes be useful, especially for
FIFOs and sockets under most flavors of \UNIX{} (including Linux in
particular), the ``size'' is the number of bytes waiting to be read at
the time of the call to \function{os.stat()}, \function{os.fstat()},
or \function{os.lstat()}; this can sometimes be useful, especially for
polling one of these special files after a non-blocking open. The
meaning of the size field for other character and block devices varies
more, depending on the implementation of the underlying system call.
......
......@@ -128,7 +128,7 @@ Notes:
\code{<>} and \code{!=} are alternate spellings for the same operator.
(I couldn't choose between \ABC{} and C! :-)
\index{ABC language@\ABC{} language}
\index{language!ABC@\ABC{}}
\index{language!ABC@\ABC}
\indexii{C}{language}
\code{!=} is the preferred spelling; \code{<>} is obsolescent.
......@@ -1105,7 +1105,7 @@ Files have the following methods:
\begin{methoddesc}[file]{readlines}{\optional{sizehint}}
Read until \EOF{} using \method{readline()} and return a list containing
the lines thus read. If the optional \var{sizehint} argument is
present, instead of reading up to \EOF{}, whole lines totalling
present, instead of reading up to \EOF, whole lines totalling
approximately \var{sizehint} bytes (possibly after rounding up to an
internal buffer size) are read. Objects implementing a file-like
interface may choose to ignore \var{sizehint} if it cannot be
......
......@@ -156,7 +156,7 @@ It is always available.
the like. Most systems require it to be in the range 0-127, and
produce undefined results otherwise. Some systems have a convention
for assigning specific meanings to specific exit codes, but these
are generally underdeveloped; Unix programs generally use 2 for
are generally underdeveloped; \UNIX{} programs generally use 2 for
command line syntax errors and 1 for all other kind of errors. If
another type of object is passed, \code{None} is equivalent to
passing zero, and any other object is printed to \code{sys.stderr}
......
......@@ -55,7 +55,7 @@ is closed and no cooked data is available.
\end{methoddesc}
\begin{methoddesc}{read_all}{}
Read all data until \EOF{}; block until connection closed.
Read all data until \EOF; block until connection closed.
\end{methoddesc}
\begin{methoddesc}{read_some}{}
......
......@@ -50,7 +50,7 @@ are initialized at the first call to \function{mktemp()}.
When set to a value other than \code{None}, this variable defines the
directory in which filenames returned by \function{mktemp()} reside.
The default is taken from the environment variable \envvar{TMPDIR}; if
this is not set, either \file{/usr/tmp} is used (on \UNIX{}), or the
this is not set, either \file{/usr/tmp} is used (on \UNIX), or the
current working directory (all other systems). No check is made to
see whether its value is valid.
\end{datadesc}
......@@ -68,7 +68,7 @@ When set to a value other than \code{None}, this variable defines the
prefix of the final component of the filenames returned by
\function{mktemp()}. A string of decimal digits is added to generate
unique filenames. The default is either \file{@\var{pid}.} where
\var{pid} is the current process ID (on \UNIX{}),
\var{pid} is the current process ID (on \UNIX),
\file{\textasciitilde\var{pid}-} on Windows NT, \file{Python-Tmp-} on
MacOS, or \file{tmp} (all other systems).
......
......@@ -5,7 +5,7 @@
\platform{Unix}
\modulesynopsis{\POSIX\ style tty control.}
\indexii{\POSIX{}}{I/O control}
\indexii{\POSIX}{I/O control}
\indexii{tty}{I/O control}
......@@ -115,7 +115,7 @@ def getpass(prompt = "Password: "):
\module{termios} module.}
\indexii{\POSIX{}}{I/O control}
\indexii{\POSIX}{I/O control}
\indexii{tty}{I/O control}
\deprecated{2.1}{Import needed constants from \refmodule{termios}
......
......@@ -19,7 +19,7 @@ The module is optional. It is supported on Windows NT and '95, SGI
IRIX, Solaris 2.x, as well as on systems that have a \POSIX{} thread
(a.k.a. ``pthread'') implementation.
\index{pthreads}
\indexii{threads}{\POSIX{}}
\indexii{threads}{\POSIX}
It defines the following constant and functions:
......
......@@ -16,13 +16,13 @@ An explanation of some terminology and conventions is in order.
\item
The \dfn{epoch}\index{epoch} is the point where the time starts. On
January 1st of that year, at 0 hours, the ``time since the epoch'' is
zero. For \UNIX{}, the epoch is 1970. To find out what the epoch is,
zero. For \UNIX, the epoch is 1970. To find out what the epoch is,
look at \code{gmtime(0)}.
\item
The functions in this module do not handle dates and times before the
epoch or far in the future. The cut-off point in the future is
determined by the C library; for \UNIX{}, it is typically in
determined by the C library; for \UNIX, it is typically in
2038\index{Year 2038}.
\item
......
......@@ -12,7 +12,7 @@ The \module{tty} module defines functions for putting the tty into
cbreak and raw modes.
Because it requires the \refmodule{termios} module, it will work
only on \UNIX{}.
only on \UNIX.
The \module{tty} module defines the following functions:
......
......@@ -39,7 +39,7 @@ Python.
The \module{Tkinter} module (``Tk interface'') is the standard Python
interface to the Tk GUI toolkit, now maintained at ActiveState. Both
Tk and \module{Tkinter} are available on most Unix platforms, as well
Tk and \module{Tkinter} are available on most \UNIX{} platforms, as well
as on Windows and Macintosh systems.
\begin{seealso}
......@@ -1674,7 +1674,7 @@ most commonly used one.
\seetitle[http://www.wxwindows.org]{wxWindows}{
is a GUI toolkit that combines the most attractive attributes of Qt,
Tk, Motif, and GTK+ in one powerful and efficient package. It is
implemented in \Cpp. wxWindows supports two flavors of Unix
implemented in \Cpp. wxWindows supports two flavors of \UNIX{}
implementation: GTK+ and Motif, and under Windows, it has a standard
Microsoft Foundation Classes (MFC) appearance, because it uses Win32
widgets. There is a Python class wrapper, independent of Tkinter.
......
......@@ -75,7 +75,7 @@ characters. A phrase between angular brackets (\code{<...>}) gives an
informal description of the symbol defined; e.g., this could be used
to describe the notion of `control character' if needed.
\index{lexical definitions}
\index{ASCII@\ASCII{}}
\index{ASCII@\ASCII}
Even though the notation used is almost the same, there is a big
difference between the meaning of lexical and syntactic definitions:
......
......@@ -14,7 +14,7 @@ insert 8-bit characters in string literals is by using octal or
hexadecimal escape sequences.
The run-time character set depends on the I/O devices connected to the
program but is generally a superset of \ASCII{}.
program but is generally a superset of \ASCII.
\strong{Future compatibility note:} It may be tempting to assume that the
character set for 8-bit characters is ISO Latin-1 (an \ASCII{}
......@@ -52,7 +52,7 @@ by following the explicit or implicit \emph{line joining} rules.
\subsection{Physical lines\label{physical}}
A physical line ends in whatever the current platform's convention is
for terminating lines. On \UNIX{}, this is the \ASCII{} LF (linefeed)
for terminating lines. On \UNIX, this is the \ASCII{} LF (linefeed)
character. On DOS/Windows, it is the \ASCII{} sequence CR LF (return
followed by linefeed). On Macintosh, it is the \ASCII{} CR (return)
character.
......@@ -142,7 +142,7 @@ turn is used to determine the grouping of statements.
First, tabs are replaced (from left to right) by one to eight spaces
such that the total number of characters up to and including the
replacement is a multiple of
eight (this is intended to be the same rule as used by \UNIX{}). The
eight (this is intended to be the same rule as used by \UNIX). The
total number of spaces preceding the first non-blank character then
determines the line's indentation. Indentation cannot be split over
multiple physical lines using backslashes; the whitespace up to the
......@@ -308,7 +308,7 @@ Literals are notations for constant values of some built-in types.
String literals are described by the following lexical definitions:
\index{string literal}
\index{ASCII@\ASCII{}}
\index{ASCII@\ASCII}
\begin{productionlist}
\production{stringliteral}
{[\token{stringprefix}](\token{shortstring} | \token{longstring})}
......@@ -388,7 +388,7 @@ to those used by Standard C. The recognized escape sequences are:
\lineii{\e\var{ooo}} {\ASCII{} character with octal value \var{ooo}}
\lineii{\e x\var{hh}} {\ASCII{} character with hex value \var{hh}}
\end{tableii}
\index{ASCII@\ASCII{}}
\index{ASCII@\ASCII}
As in Standard C, up to three octal digits are accepted. However,
exactly two hex digits are taken in hex escapes.
......@@ -596,7 +596,7 @@ sequence of three periods has a special meaning as an ellipsis in slices.
The second half of the list, the augmented assignment operators, serve
lexically as delimiters, but also perform an operation.
The following printing ASCII characters have special meaning as part
The following printing \ASCII{} characters have special meaning as part
of other tokens or are otherwise significant to the lexical analyzer:
\begin{verbatim}
......@@ -606,7 +606,7 @@ of other tokens or are otherwise significant to the lexical analyzer:
The following printing \ASCII{} characters are not used in Python. Their
occurrence outside string literals and comments is an unconditional
error:
\index{ASCII@\ASCII{}}
\index{ASCII@\ASCII}
\begin{verbatim}
@ $ ?
......
......@@ -279,14 +279,14 @@ read from a file.
\obindex{string}
\index{character}
\index{byte}
\index{ASCII@\ASCII{}}
\index{ASCII@\ASCII}
(On systems whose native character set is not \ASCII{}, strings may use
(On systems whose native character set is not \ASCII, strings may use
EBCDIC in their internal representation, provided the functions
\function{chr()} and \function{ord()} implement a mapping between \ASCII{} and
EBCDIC, and string comparison preserves the \ASCII{} order.
Or perhaps someone can propose a better rule?)
\index{ASCII@\ASCII{}}
\index{ASCII@\ASCII}
\index{EBCDIC}
\index{character set}
\indexii{string}{comparison}
......
......@@ -52,7 +52,7 @@ For a description of standard objects and modules, see the
\citetitle[../lib/lib.html]{Python Library Reference} document. The
\citetitle[../ref/ref.html]{Python Reference Manual} gives a more
formal definition of the language. To write extensions in C or
\Cpp{}, read \citetitle[../ext/ext.html]{Extending and Embedding the
\Cpp, read \citetitle[../ext/ext.html]{Extending and Embedding the
Python Interpreter} and \citetitle[../api/api.html]{Python/C API
Reference}. There are also several books covering Python in depth.
......@@ -182,7 +182,7 @@ you can exit the interpreter by typing the following commands:
\samp{import sys; sys.exit()}.
The interpreter's line-editing features usually aren't very
sophisticated. On \UNIX{}, whoever installed the interpreter may have
sophisticated. On \UNIX, whoever installed the interpreter may have
enabled support for the GNU readline library, which adds more
elaborate interactive editing and history features. Perhaps the
quickest check to see whether command line editing is supported is
......@@ -2230,7 +2230,7 @@ the environment variable \envvar{PYTHONPATH}. This has the same syntax as
the shell variable \envvar{PATH}, that is, a list of
directory names. When \envvar{PYTHONPATH} is not set, or when the file
is not found there, the search continues in an installation-dependent
default path; on \UNIX{}, this is usually \file{.:/usr/local/lib/python}.
default path; on \UNIX, this is usually \file{.:/usr/local/lib/python}.
Actually, modules are searched in the list of directories given by the
variable \code{sys.path} which is initialized from the directory
......@@ -2599,7 +2599,7 @@ in the \module{Sound.Effects} package, it can use \code{from
Sound.Effects import echo}.
%(One could design a notation to refer to parent packages, similar to
%the use of ".." to refer to the parent directory in Unix and Windows
%the use of ".." to refer to the parent directory in \UNIX{} and Windows
%filesystems. In fact, the \module{ni} module, which was the
%ancestor of this package system, supported this using \code{__} for
%the package containing the current module,
......@@ -3335,7 +3335,7 @@ subscripting etc.) can be redefined for class instances.
Lacking universally accepted terminology to talk about classes, I will
make occasional use of Smalltalk and \Cpp{} terms. (I would use Modula-3
terms, since its object-oriented semantics are closer to those of
Python than \Cpp{}, but I expect that few readers have heard of it.)
Python than \Cpp, but I expect that few readers have heard of it.)
I also have to warn you that there's a terminological pitfall for
object-oriented readers: the word ``object'' in Python does not
......@@ -3592,7 +3592,7 @@ two kinds of valid attribute names.
The first I'll call \emph{data attributes}. These correspond to
``instance variables'' in Smalltalk, and to ``data members'' in
\Cpp{}. Data attributes need not be declared; like local variables,
\Cpp. Data attributes need not be declared; like local variables,
they spring into existence when they are first assigned to. For
example, if \code{x} is the instance of \class{MyClass} created above,
the following piece of code will print the value \code{16}, without
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment