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

Skip to content

Commit 66571cc

Browse files
committed
Improve a couple of references to the language reference, making them
hyperlinks to relevant sections. Clarify the conditions under which the "softspace" attribute of file-like objects can "just work" (with relation to overriding of attribute access in user-defined classes).
1 parent 7acb218 commit 66571cc

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

Doc/lib/libstdtypes.tex

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ \subsection{Truth Value Testing \label{truth}}
4040
\item instances of user-defined classes, if the class defines a
4141
\method{__nonzero__()} or \method{__len__()} method, when that
4242
method returns zero.\footnote{Additional information on these
43-
special methods may be found in the \emph{Python Reference Manual}.}
43+
special methods may be found in the \citetitle[../ref/ref.html]{Python
44+
Reference Manual}.}
4445

4546
\end{itemize}
4647

@@ -142,9 +143,9 @@ \subsection{Comparisons \label{comparisons}}
142143

143144
Instances of a class normally compare as non-equal unless the class
144145
\withsubitem{(instance method)}{\ttindex{__cmp__()}}
145-
defines the \method{__cmp__()} method. Refer to the \emph{Python
146-
Reference Manual} for information on the use of this method to effect
147-
object comparisons.
146+
defines the \method{__cmp__()} method. Refer to the
147+
\citetitle[../ref/customization.html]{Python Reference Manual} for
148+
information on the use of this method to effect object comparisons.
148149

149150
\strong{Implementation note:} Objects of different types except
150151
numbers are ordered by their type names; objects of the same types
@@ -1105,9 +1106,10 @@ \subsubsection{File Objects\obindex{file}
11051106
before another value when using the \keyword{print} statement.
11061107
Classes that are trying to simulate a file object should also have a
11071108
writable \member{softspace} attribute, which should be initialized to
1108-
zero. This will be automatic for classes implemented in Python; types
1109-
implemented in C will have to provide a writable \member{softspace}
1110-
attribute.
1109+
zero. This will be automatic for most classes implemented in Python
1110+
(care may be needed for objects that override attribute access); types
1111+
implemented in C will have to provide a writable
1112+
\member{softspace} attribute.
11111113
\end{memberdesc}
11121114

11131115
\subsubsection{Internal Objects \label{typesinternal}}

0 commit comments

Comments
 (0)