Conversion from floating point to (long or plain) integer may round or
truncate as in \C{}; see functions \function{floor()} and \function{ceil()} in
module \module{math} for well-defined conversions.
-\withsubitem{(in module math)}{%
- \ttindex{floor()}%
- \ttindex{ceil()}}
+\withsubitem{(in module math)}{\ttindex{floor()}\ttindex{ceil()}}
\indexii{numeric}{conversions}
\refbimodindex{math}
\indexii{C@\C{}}{language}
\end{description}
-\subsubsection{More String Operations}
+
+\subsubsection{More String Operations \label{typesseq-strings}}
String objects have one unique built-in operation: the \code{\%}
operator (modulo) with a string left argument interprets this string
\refstmodindex{string}
\refstmodindex{re}
-\subsubsection{Mutable Sequence Types}
+\subsubsection{Mutable Sequence Types \label{typesseq-mutable}}
List objects support additional operations that allow in-place
modification of the object.
\indexii{subscript}{assignment}
\indexii{slice}{assignment}
\stindex{del}
-\withsubitem{(list method)}{%
- \ttindex{append()}%
- \ttindex{extend()}%
- \ttindex{count()}%
- \ttindex{index()}%
- \ttindex{insert()}%
- \ttindex{pop()}%
- \ttindex{remove()}%
- \ttindex{reverse()}%
+\withsubitem{(list method)}{
+ \ttindex{append()}
+ \ttindex{extend()}
+ \ttindex{count()}
+ \ttindex{index()}
+ \ttindex{insert()}
+ \ttindex{pop()}
+ \ttindex{remove()}
+ \ttindex{reverse()}
\ttindex{sort()}}
\noindent
Notes:
\indexiii{operations on}{dictionary}{type}
\stindex{del}
\bifuncindex{len}
-\withsubitem{(dictionary method)}{%
- \ttindex{clear()}%
- \ttindex{copy()}%
- \ttindex{has_key()}%
- \ttindex{items()}%
- \ttindex{keys()}%
- \ttindex{update()}%
- \ttindex{values()}%
+\withsubitem{(dictionary method)}{
+ \ttindex{clear()}
+ \ttindex{copy()}
+ \ttindex{has_key()}
+ \ttindex{items()}
+ \ttindex{keys()}
+ \ttindex{update()}
+ \ttindex{values()}
\ttindex{get()}}
\noindent
Notes:
The interpreter supports several other kinds of objects.
Most of these support only one or two operations.
-\subsubsection{Modules}
+\subsubsection{Modules \label{typesmodules}}
The only special operation on a module is attribute access:
\code{\var{m}.\var{name}}, where \var{m} is a module and \var{name}
Modules are written like this: \code{<module 'sys'>}.
-\subsubsection{Classes and Class Instances}
+\subsubsection{Classes and Class Instances \label{typesobjects}}
\nodename{Classes and Instances}
See Chapters 3 and 7 of the \emph{Python Reference Manual} for these.
-\subsubsection{Functions}
+\subsubsection{Functions \label{typesfunctions}}
Function objects are created by function definitions. The only
operation on a function object is to call it:
the function \var{f} was defined).
-\subsubsection{Methods}
+\subsubsection{Methods \label{typesmethods}}
\obindex{method}
Methods are functions that are called using the attribute notation.
attribute.
\end{memberdesc}
-\subsubsection{Internal Objects}
+\subsubsection{Internal Objects \label{typesinternal}}
See the \emph{Python Reference Manual} for this information. It
describes code objects, stack frame objects, traceback objects, and