This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients christian.heimes, erlendaasland, pablogsal, serhiy.storchaka, shreyanavigyan, vstinner
Date 2021-04-30.16:05:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1619798708.69.0.061113015526.issue43916@roundup.psfhosted.org>
In-reply-to
Content
It seems like _sqlite3 heap types support regular instantiation and so that no change is needed.

* sqlite3.Cache

    {Py_tp_new, PyType_GenericNew},

* sqlite3.Connection

    {Py_tp_new, PyType_GenericNew},
    {Py_tp_init, pysqlite_connection_init},

* sqlite3.Cursor

    {Py_tp_new, PyType_GenericNew},
    {Py_tp_init, pysqlite_cursor_init},

* sqlite3.Node

    {Py_tp_new, PyType_GenericNew},

* sqlite3.Row

    {Py_tp_new, pysqlite_row_new},

* sqlite3.Statement

    {Py_tp_new, PyType_GenericNew},


$ ./python
Python 3.10.0a7+
>>> import _sqlite3
>>> conn=_sqlite3.Connection(":memory:")

>>> type(conn)()
TypeError: function missing required argument 'database' (pos 1)
>>> conn2 = type(conn)(":memory:")

>>> list(conn.execute("SELECT 1;"))
[(1,)]
>>> list(conn2.execute("SELECT 1;"))
[(1,)]
History
Date User Action Args
2021-04-30 16:05:08vstinnersetrecipients: + vstinner, christian.heimes, serhiy.storchaka, pablogsal, erlendaasland, shreyanavigyan
2021-04-30 16:05:08vstinnersetmessageid: <1619798708.69.0.061113015526.issue43916@roundup.psfhosted.org>
2021-04-30 16:05:08vstinnerlinkissue43916 messages
2021-04-30 16:05:08vstinnercreate