Commit 4012b80e authored by Fred Drake's avatar Fred Drake

Add availability information for a couple of the types, and notes on writing

string-type tests for versions of Python built without Unicode support.
parent 72951e7a
...@@ -48,7 +48,8 @@ The type of floating point numbers (e.g. \code{1.0}). ...@@ -48,7 +48,8 @@ The type of floating point numbers (e.g. \code{1.0}).
\end{datadesc} \end{datadesc}
\begin{datadesc}{ComplexType} \begin{datadesc}{ComplexType}
The type of complex numbers (e.g. \code{1.0j}). The type of complex numbers (e.g. \code{1.0j}). This is not defined
if Python was built without complex number support.
\end{datadesc} \end{datadesc}
\begin{datadesc}{StringType} \begin{datadesc}{StringType}
...@@ -56,7 +57,8 @@ The type of character strings (e.g. \code{'Spam'}). ...@@ -56,7 +57,8 @@ The type of character strings (e.g. \code{'Spam'}).
\end{datadesc} \end{datadesc}
\begin{datadesc}{UnicodeType} \begin{datadesc}{UnicodeType}
The type of Unicode character strings (e.g. \code{u'Spam'}). The type of Unicode character strings (e.g. \code{u'Spam'}). This is
not defined if Python was built without Unicode support.
\end{datadesc} \end{datadesc}
\begin{datadesc}{TupleType} \begin{datadesc}{TupleType}
...@@ -157,7 +159,10 @@ The type of buffer objects created by the ...@@ -157,7 +159,10 @@ The type of buffer objects created by the
\end{datadesc} \end{datadesc}
\begin{datadesc}{StringTypes} \begin{datadesc}{StringTypes}
A list containing \var{StringType} and \var{UnicodeType} used to A sequence containing \code{StringType} and \code{UnicodeType} used to
facilitate easier checking for any string object, e.g. \code{s in facilitate easier checking for any string object. Using this is more
types.StringTypes}. portable than using a sequence of the two string types constructed
elsewhere since it only contains \code{UnicodeType} if it has been
built in the running version of Python. For example:
\code{isinstance(s, types.StringTypes)}.
\end{datadesc} \end{datadesc}
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