[DB-SIG] Connect vs. connect

M.-A. Lemburg mal@lemburg.com
Mon, 13 Mar 2000 10:00:48 +0100


Peter Bittner wrote:
> 
> Hi there!
> 
> > db = MySQLdb.connect(db='mydb',user='myuser',passwd='mypasswd')
> 
> Why is connect an function in MySQLdb, whereas in DCOracle it is a
> constructor Connect. - Where is the API compatibility gone?
> 
> > db = DCOracle.Connect(username + '/' + pwd + '@' + system)
> 
> DCOracle supports the Python API 1.0 not 2.0, is that the reason?

No, DB API 1.0 states to use the name of the module as constructor.
DB API 2.0 defines .connect(). The name .Connect() is either DC's
own invention or came from early versions of the DB API 2.0.

FYI, mxODBC provides .connect() and an alias .Connect() as well
as the DB API 1.0 names for each of the subpackages, e.g.
ODBC.iODBC.iODBC(...).

> Peter
> 
> | Peter H. Bittner
> | International Student at Aston University
> | e-mail: bittneph@aston.ac.uk
> | web: http://beam.to/bimbo
> +--------------------------
> 
> _______________________________________________
> DB-SIG maillist  -  DB-SIG@python.org
> http://www.python.org/mailman/listinfo/db-sig

-- 
Marc-Andre Lemburg
______________________________________________________________________
Business:                                      http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/