diff MySQLdb/__init__.py @ 15:a275593a1630 MySQLdb

More doc fixes
author adustman
date Mon, 26 Feb 2007 18:59:22 +0000
parents 3f4c6af70e52
children d55bfb1a4701
line wrap: on
line diff
--- a/MySQLdb/__init__.py	Mon Feb 26 18:08:28 2007 +0000
+++ b/MySQLdb/__init__.py	Mon Feb 26 18:59:22 2007 +0000
@@ -1,16 +1,19 @@
-"""MySQLdb - A DB API v2.0 compatible interface to MySQL.
+"""
+MySQLdb
+=======
+A DB API v2.0 compatible interface to MySQL
+-------------------------------------------
 
 This package is a wrapper around _mysql, which mostly implements the
 MySQL C API.
 
-connect() -- connects to server
-
 See the C API specification and the MySQL documentation for more info
 on other items.
 
+For information on the DB API, see PEP-249.
+
 For information on how MySQLdb handles type conversion, see the
 MySQLdb.converters module.
-
 """
 
 __revision__ = """$Revision$"""[11:-2]
@@ -33,10 +36,20 @@
     DateFromTicks, TimeFromTicks, TimestampFromTicks
 
 from sets import ImmutableSet
+
 class DBAPISet(ImmutableSet):
 
-    """A special type of set for which A == x is true if A is a
-    DBAPISet and x is a member of that set."""
+    """A special type of set for which A == x is True if A is a
+    DBAPISet and x is a member of that set.
+    
+      >>> FIELD_TYPE.VAR_STRING == STRING
+      True
+      >>> FIELD_TYPE.DATE == NUMBER
+      False
+      >>> FIELD_TYPE.DATE != DATE
+      False
+      
+    """
 
     def __ne__(self, other):
         from sets import BaseSet
@@ -77,17 +90,18 @@
 
 connect = Connection = Connect
 
-__all__ = [ 'BINARY', 'Binary', 'Connect', 'Connection', 'DATE',
-    'Date', 'Time', 'Timestamp', 'DateFromTicks', 'TimeFromTicks',
-    'TimestampFromTicks', 'DataError', 'DatabaseError', 'Error',
-    'FIELD_TYPE', 'IntegrityError', 'InterfaceError', 'InternalError',
-    'MySQLError', 'NULL', 'NUMBER', 'NotSupportedError', 'DBAPISet',
-    'OperationalError', 'ProgrammingError', 'ROWID', 'STRING', 'TIME',
-    'TIMESTAMP', 'Warning', 'apilevel', 'connect', 'connections',
-    'constants', 'cursors', 'debug', 'escape', 'escape_dict',
-    'escape_sequence', 'escape_string', 'get_client_info',
-    'paramstyle', 'string_literal', 'threadsafety', 'version_info']
+__all__ = [ 'BINARY', 'Binary', 'Connect', 'Connection', 'DATE', 'Date',
+            'Time', 'Timestamp', 'DateFromTicks', 'TimeFromTicks', 'TimestampFromTicks',
+            'DataError', 'DatabaseError', 'Error', 'FIELD_TYPE', 'IntegrityError',
+            'InterfaceError', 'InternalError', 'MySQLError', 'NULL', 'NUMBER',
+            'NotSupportedError', 'DBAPISet', 'OperationalError', 'ProgrammingError',
+            'ROWID', 'STRING', 'TIME', 'TIMESTAMP', 'Warning', 'apilevel', 'connect',
+            'connections', 'constants', 'converters', 'cursors', 'debug', 'escape',
+            'escape_dict', 'escape_sequence', 'escape_string', 'get_client_info',
+            'paramstyle', 'string_literal', 'threadsafety', 'version_info']
 
 
-
-
+if __name__ == "__main__":
+    import doctest
+    doctest.testmod()
+