]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
SF bug #560286: Add docs for 'basestring'
authorRaymond Hettinger <python@rcn.com>
Tue, 9 Sep 2003 01:13:59 +0000 (01:13 +0000)
committerRaymond Hettinger <python@rcn.com>
Tue, 9 Sep 2003 01:13:59 +0000 (01:13 +0000)
Doc/lib/libfuncs.tex

index b1df22219dd4f719416e8271db523e8116953551..4971f451f0c191c8676991bc17875c6f7de11dec 100644 (file)
@@ -80,6 +80,15 @@ def my_import(name):
                    above.}
 \end{funcdesc}
 
+\begin{funcdesc}{basestring}{}
+  This abstract type is the superclass for \class{str} and \class{unicode}.
+  It cannot be called or instantiated, but it can be used to test whether
+  an object is an instance of \class{str} or \class{unicode}.
+  \code{isinstance(obj, basestring)} is equivalent to
+  \code{isinstance(obj, (str, unicode))}.
+  \versionadded{2.3}
+\end{funcdesc}
+
 \begin{funcdesc}{bool}{\optional{x}}
   Convert a value to a Boolean, using the standard truth testing
   procedure.  If \code{x} is false, this returns \code{False};