Skip to content

Conversation

@erlend-aasland
Copy link
Contributor

@erlend-aasland erlend-aasland commented May 8, 2021

@erlend-aasland
Copy link
Contributor Author

@corona10 I'm considering adding skip news label here, as this only affects the internal machinery of the sqlite3 module.

@corona10
Copy link
Member

corona10 commented May 9, 2021

as this only affects the internal machinery of the sqlite3 module

@erlend-aasland
I don't think so

Statement instances are no longer weakly referencable

IMHO, At least the statement instance is changed, we can add the news.d about changed caching mechanism.

@erlend-aasland
Copy link
Contributor Author

as this only affects the internal machinery of the sqlite3 module

I don't think so

Right, because of 8c888dc, I presume.

Statement instances are no longer weakly referencable

IMHO, At least the statement instance is changed, we can add the news.d about changed caching mechanism.

Even if sqlite3.Statement is not accessible for the user?

$ python3.10
>>> 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'

@corona10
Copy link
Member

corona10 commented May 9, 2021

@erlend-aasland
Hmm okay, I changed my mind, let's add skip news label :)

@erlend-aasland
Copy link
Contributor Author

Hmm okay, I changed my mind, let's add skip news label :)

:) But notice that it is possible to extract the Statement type using some undocumented tricks:

python3.10
Python 3.10.0a7 (v3.10.0a7:53e55290cf, Apr  5 2021, 15:00:06) [Clang 12.0.0 (clang-1200.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
>>> cx = sqlite3.connect(":memory:")
>>> stmt = cx("select 1")
>>> type(stmt)
<class 'sqlite3.Statement'>

@berkerpeksag
Copy link
Member

True, this is an implementation detail and we don't need to add a NEWS entry.

@erlend-aasland erlend-aasland marked this pull request as draft May 25, 2021 22:27
@erlend-aasland erlend-aasland changed the title bpo-44079: Strip superfluous statement cache from sqlite3.Connection [WIP] bpo-44079: Strip superfluous statement cache from sqlite3.Connection Jun 20, 2021
@erlend-aasland erlend-aasland marked this pull request as ready for review June 24, 2021 21:12
@erlend-aasland erlend-aasland changed the title [WIP] bpo-44079: Strip superfluous statement cache from sqlite3.Connection bpo-44079: Strip superfluous statement cache from sqlite3.Connection Jun 24, 2021
@pablogsal pablogsal merged commit 243b6c3 into python:main Aug 18, 2021
@erlend-aasland erlend-aasland deleted the sqlite-remove-superfluous-stmt-cache branch August 19, 2021 06:11
erlend-aasland pushed a commit to erlend-aasland/cpython that referenced this pull request Aug 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants