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.
Created on 2021年05月09日 08:28 by erlendaasland, last changed 2022年04月11日 14:59 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 26567 | merged | erlendaasland, 2021年06月06日 22:58 | |
| PR 26813 | closed | miss-islington, 2021年06月20日 19:24 | |
| PR 26816 | merged | erlendaasland, 2021年06月20日 20:47 | |
| Messages (3) | |||
|---|---|---|---|
| msg393310 - (view) | Author: Erlend E. Aasland (erlendaasland) * (Python triager) | Date: 2021年05月09日 08:28 | |
Currently, the sqlite3.Statement type is not exposed in the module dict: >>> import sqlite3 >>> sqlite3.Statement Traceback (most recent call last): File "<stdin>", line 1, in <module> 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) <class 'sqlite3.Statement'> >>> type(stmt)() <sqlite3.Statement object at 0x109006b30> 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. |
|||
| msg396189 - (view) | Author: Pablo Galindo Salgado (pablogsal) * (Python committer) | Date: 2021年06月20日 19:24 | |
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 |
|||
| msg396201 - (view) | Author: Pablo Galindo Salgado (pablogsal) * (Python committer) | Date: 2021年06月20日 21:07 | |
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 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:59:45 | admin | set | github: 88253 |
| 2021年06月20日 21:29:55 | erlendaasland | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2021年06月20日 21:07:41 | pablogsal | set | messages: + msg396201 |
| 2021年06月20日 20:47:53 | erlendaasland | set | pull_requests: + pull_request25397 |
| 2021年06月20日 19:24:59 | miss-islington | set | nosy:
+ miss-islington pull_requests: + pull_request25395 |
| 2021年06月20日 19:24:35 | pablogsal | set | nosy:
+ pablogsal messages: + msg396189 |
| 2021年06月06日 22:58:55 | erlendaasland | set | keywords:
+ patch stage: patch review pull_requests: + pull_request25156 |
| 2021年05月09日 08:28:09 | erlendaasland | create | |