Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-101815: remove functools.cached_property key sharing doc warnings#101816

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
carljm wants to merge5 commits intopython:main
base:main
Choose a base branch
Loading
fromcarljm:cached_property_docs

Conversation

carljm
Copy link
Member

@carljmcarljm commentedFeb 10, 2023
edited by bedevere-bot
Loading

@carljm
Copy link
MemberAuthor

Tbh I am not sure it even makes sense to mention the added memory usage from__dict__ access at all. It's a bit strange to mention that and then immediately recommend@cache as an alternative, which has a much higher likelihood of causing excessive memory use, since it creates an unbounded cache which indefinitely holds strong references to every instance the cached property is ever accessed on.

* main: (760 commits)pythonGH-104102: Optimize `pathlib.Path.glob()` handling of `../` pattern segments (pythonGH-104103)pythonGH-104104: Optimize `pathlib.Path.glob()` by avoiding repeated calls to `os.path.normcase()` (pythonGH-104105)pythongh-103822: [Calendar] change return value to enum for day and month APIs (pythonGH-103827)pythongh-65022: Fix description of tuple return value in copyreg (python#103892)pythonGH-103525: Improve exception message from `pathlib.PurePath()` (pythonGH-103526)pythongh-84436: Add integration C API tests for immortal objects (pythongh-103962)pythongh-103743: Add PyUnstable_Object_GC_NewWithExtraData (pythonGH-103744)pythongh-102997: Update Windows installer to SQLite 3.41.2. (python#102999)pythonGH-103484: Fix redirected permanently URLs (python#104001)  Improve assert_type phrasing (python#104081)pythongh-102997: Update macOS installer to SQLite 3.41.2. (pythonGH-102998)pythonGH-103472: close response in HTTPConnection._tunnel (python#103473)pythongh-88496: IDLE - fix another test on macOS (python#104075)pythongh-94673: Hide Objects in PyTypeObject Behind Accessors (pythongh-104074)pythongh-94673: Properly Initialize and Finalize Static Builtin Types for Each Interpreter (pythongh-104072)pythongh-104016: Skip test for deeply neste f-strings on wasi (python#104071)pythongh-104057: Fix direct invocation of test_super (python#104064)pythongh-87092: Expose assembler to unit tests (python#103988)pythongh-97696: asyncio eager tasks factory (python#102853)pythongh-84436: Immortalize in _PyStructSequence_InitBuiltinWithFlags() (pythongh-104054)  ...
@carljmcarljm changed the titlegh-101815: fix functools.cached_property key sharing doc warningsgh-101815: remove functools.cached_property key sharing doc warningsMay 3, 2023
@carljm
Copy link
MemberAuthor

See the issue for detailed discussion of the current situation with key-sharing and instance memory use in 3.12.

Because the key-sharing implementation is now quite different than what is described in PEP 412 (and PEPs are not living documentation), I think at the very least it is now misleading to link PEP 412 in this documentation.

These performance and memory optimization details are undocumented and subject to change, and their exact impact is very dependent on details of the usage patterns. In most cases the scale of these memory effects will not be significant in comparison to the memory impact of the actual caching strategy chosen. I don't think it serves users well to either go into great detail on the exact behavior of instance key sharing here, or to make vague general statements that may or may not be true in any particular case.

@carljmcarljm requested a review fromambvMay 3, 2023 00:29
@carljm
Copy link
MemberAuthor

@rhettinger do you have opinions on what we should include in this documentation here?

Also requesting review from@ambv, since this has been sitting for quite a while without review.

carljmand others added2 commitsMay 15, 2023 09:05
* main: (204 commits)pythongh-101819: Fix _io clinic input for unused base class method stubs (python#104418)pythongh-101819: Isolate `_io` (python#101948)  Bump mypy from 1.2.0 to 1.3.0 in /Tools/clinic (python#104501)pythongh-104494: Update certain Tkinter pack/place tests for Tk 8.7 errors (python#104495)pythongh-104050: Run mypy on `clinic.py` in CI (python#104421)pythongh-104490: Consistently define phony make targets (python#104491)pythongh-67056: document that registering/unregistering an atexit func from within an atexit func is undefined (python#104473)pythongh-104487: PYTHON_FOR_REGEN must be minimum Python 3.10 (python#104488)pythongh-101282: move BOLT config after PGO (pythongh-104493)pythongh-104469 Convert _testcapi/float.c to use AC (pythongh-104470)pythongh-104456: Fix ref leak in _ctypes.COMError (python#104457)pythongh-98539: Make _SSLTransportProtocol.abort() safe to call when closed (python#104474)pythongh-104337: Clarify random.gammavariate doc entry  (python#104410)  Minor improvements to typing docs (python#104465)pythongh-87092: avoid gcc warning on uninitialized struct field in assemble.c (python#104460)pythonGH-71383: IDLE - Document testing subsets of modules (python#104463)pythongh-104454: Fix refleak in AttributeError_reduce (python#104455)pythongh-75710: IDLE - add docstrings and comments to editor module (python#104446)pythongh-91896: Revert some very noisy DeprecationWarnings for `ByteString` (python#104424)  Add a mention of PYTHONBREAKPOINT to breakpoint() docs (python#104430)  ...
@ambvambv added the needs backport to 3.12only security fixes labelDec 9, 2023
@serhiy-storchakaserhiy-storchaka added the needs backport to 3.13bugs and security fixes labelMay 9, 2024
@hugovkhugovk removed the needs backport to 3.12only security fixes labelApr 10, 2025
@serhiy-storchakaserhiy-storchaka added the needs backport to 3.14bugs and security fixes labelMay 8, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@rhettingerrhettingerAwaiting requested review from rhettingerrhettinger is a code owner

@ambvambvAwaiting requested review from ambv

Assignees
No one assigned
Labels
awaiting reviewdocsDocumentation in the Doc dirneeds backport to 3.13bugs and security fixesneeds backport to 3.14bugs and security fixesskip news
Projects
Status: Todo
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

functools.cached_property doc warnings about key-sharing are obsolete
5 participants
@carljm@ambv@hugovk@serhiy-storchaka@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp