Skip to content

bpo-42127: Document effect of cached_property on key-sharing dicts#22930

Merged
rhettinger merged 1 commit into
python:masterfrom
rhettinger:cached_property_alternative
Oct 25, 2020
Merged

bpo-42127: Document effect of cached_property on key-sharing dicts#22930
rhettinger merged 1 commit into
python:masterfrom
rhettinger:cached_property_alternative

Conversation

@rhettinger
Copy link
Copy Markdown
Contributor

@rhettinger rhettinger commented Oct 23, 2020

Copy link
Copy Markdown
Contributor

@Jongy Jongy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a core reviewer, but LGTM :)

The workaround is nice but perhaps you could add a word on the performance hit it gives? That is, by avoiding the insertion of a new dict key, you'll have slower code when accessing the already-cached object.

@rhettinger rhettinger merged commit 48be6b1 into python:master Oct 25, 2020
@miss-islington
Copy link
Copy Markdown
Contributor

Thanks @rhettinger for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 25, 2020
…ries (pythonGH-22930)

(cherry picked from commit 48be6b1)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
@bedevere-bot
Copy link
Copy Markdown

GH-22955 is a backport of this pull request to the 3.9 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants