[Python-ideas] Official MySQL module
mertz at gnosis.cx
Thu Mar 7 23:29:39 CET 2013
On Mar 7, 2013, at 2:00 PM, Gregory P. Smith wrote:
> No database connector module should ever be part of the standard library unless that entire database is included as part of Python distributions. MySQL isn't part of Python so all mysql connector modules belong as third party things (perhaps as part of mysql itself if they wanted to get their act together). want sqlite? we bundle it. want something else? you have to install something else separately so you have to install its connector module separately as well.
I think I'm convinced by Gregory here, and withdraw my previous opinion. It does feel strange to have a Python module in the standard "batteries-included" distribution simply do *nothing* if other software doesn't happen to be installed. Although, off the top of my head, 'webbrowser' is also exactly such a module (but one can argue that every end-user OS includes at least one such external tool, so it's a kind of "system service").
Obviously, as Guido points out, when I wrote 'sqlite3' I really meant 'db-API 2.0'. But I was just being concrete rather than abstract about it, since one is a module and the other a specification. I.e. it's conceivable that a program might change one line and work:
# import sqlite3 as mydb
import mysql as mydb
But there's no line in a Python program like:
import db_api20 as mydb
(well, at least two lines really, there's not way the '.connect()' can be DB-independent).
Dred Scott 1857; Santa Clara 1886; Plessy 1892; Korematsu 1944; Eldred 2003
More information about the Python-ideas