diff options
author | Fred Drake <fdrake@acm.org> | 2002-05-21 14:28:22 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2002-05-21 14:28:22 (GMT) |
commit | 5ecb7aaa6a6e8ee60e81831da1a15514e59f4489 (patch) | |
tree | dc3c7cd50592503a282ee261f70f590229eaf26d | |
parent | fecdb494dad7be0f556bfeafb65e30650227d8f5 (diff) | |
download | cpython-5ecb7aaa6a6e8ee60e81831da1a15514e59f4489.zip cpython-5ecb7aaa6a6e8ee60e81831da1a15514e59f4489.tar.gz cpython-5ecb7aaa6a6e8ee60e81831da1a15514e59f4489.tar.bz2 |
Add availability information for a couple of the types, and notes on writing
string-type tests for versions of Python built without Unicode support.
-rw-r--r-- | Doc/lib/libtypes.tex | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/Doc/lib/libtypes.tex b/Doc/lib/libtypes.tex index 3f2a73f..ac337da 100644 --- a/Doc/lib/libtypes.tex +++ b/Doc/lib/libtypes.tex @@ -48,7 +48,8 @@ The type of floating point numbers (e.g. \code{1.0}). \end{datadesc} \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} \begin{datadesc}{StringType} @@ -56,7 +57,8 @@ The type of character strings (e.g. \code{'Spam'}). \end{datadesc} \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} \begin{datadesc}{TupleType} @@ -157,7 +159,10 @@ The type of buffer objects created by the \end{datadesc} \begin{datadesc}{StringTypes} -A list containing \var{StringType} and \var{UnicodeType} used to -facilitate easier checking for any string object, e.g. \code{s in -types.StringTypes}. +A sequence containing \code{StringType} and \code{UnicodeType} used to +facilitate easier checking for any string object. Using this is more +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} |