[issue44087] [sqlite3] consider adding Py_TPFLAGS_DISALLOW_INSTANTIATION to sqlite3.Statement

2021-06-20 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44087] [sqlite3] consider adding Py_TPFLAGS_DISALLOW_INSTANTIATION to sqlite3.Statement

2021-06-20 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset ccc95c7b4799570c2d7e4de3d579860ad833e1f8 by Erlend Egeberg 
Aasland in branch '3.10':
 [3.10] bpo-44087: Disallow instantiation of sqlite3.Statement (GH-26567) 
(GH-26816)
https://github.com/python/cpython/commit/ccc95c7b4799570c2d7e4de3d579860ad833e1f8


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44087] [sqlite3] consider adding Py_TPFLAGS_DISALLOW_INSTANTIATION to sqlite3.Statement

2021-06-20 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +25397
pull_request: https://github.com/python/cpython/pull/26816

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44087] [sqlite3] consider adding Py_TPFLAGS_DISALLOW_INSTANTIATION to sqlite3.Statement

2021-06-20 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +25395
pull_request: https://github.com/python/cpython/pull/26813

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44087] [sqlite3] consider adding Py_TPFLAGS_DISALLOW_INSTANTIATION to sqlite3.Statement

2021-06-20 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 7d0a47e1affd0a2f56600f3e9473f55f931595bd by Erlend Egeberg 
Aasland in branch 'main':
bpo-44087: Disallow instantiation of sqlite3.Statement (GH-26567)
https://github.com/python/cpython/commit/7d0a47e1affd0a2f56600f3e9473f55f931595bd


--
nosy: +pablogsal

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44087] [sqlite3] consider adding Py_TPFLAGS_DISALLOW_INSTANTIATION to sqlite3.Statement

2021-06-06 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
keywords: +patch
pull_requests: +25156
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26567

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44087] [sqlite3] consider adding Py_TPFLAGS_DISALLOW_INSTANTIATION to sqlite3.Statement

2021-05-09 Thread Erlend E. Aasland


New submission from Erlend E. Aasland :

Currently, the sqlite3.Statement type is not exposed in the module dict:

>>> import sqlite3
>>> sqlite3.Statement
Traceback (most recent call last):
  File "", line 1, in 
  File 
"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/sqlite3/__init__.py",
 line 37, in __getattr__
raise AttributeError(f"module 'sqlite3' has no attribute '{name}'")
AttributeError: module 'sqlite3' has no attribute 'Statement'


It is possible to extract it using this trick:
>>> cx = sqlite3.connect(":memory:")
>>> stmt = cx("select 1")
>>> type(stmt)

>>> type(stmt)()


There is no use case for this; statement objects belong to the internal 
workings of the sqlite3 module. I suggest adding 
Py_TPFLAGS_DISALLOW_INSTANTIATION to make this fact more explicit.

--
keywords: easy (C)
messages: 393310
nosy: berker.peksag, erlendaasland, serhiy.storchaka
priority: normal
severity: normal
status: open
title: [sqlite3] consider adding Py_TPFLAGS_DISALLOW_INSTANTIATION to 
sqlite3.Statement
type: enhancement

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com