Skip to content

gh-107619: Extend functools LRU cache docs with generators and async functions #107934

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Aug 20, 2023

Conversation

Hels15
Copy link
Contributor

@Hels15 Hels15 commented Aug 14, 2023

Extend functools LRU cache docs with generators and async functions. An async function returns a coroutine, not the actual function result. That means that the cache decorator is caching the coroutine, not the function result. Since the coroutine is not "reawaitable", we get an exception. This pr includes generators and async functions in the list of places where it doesn't cache doesn't make sense.


📚 Documentation preview 📚: https://cpython-previews--107934.org.readthedocs.build/

@Hels15 Hels15 requested a review from rhettinger as a code owner August 14, 2023 11:09
@ghost
Copy link

ghost commented Aug 14, 2023

All commit authors signed the Contributor License Agreement.
CLA signed

@AA-Turner AA-Turner changed the title gh-107619:Extend functools LRU cache docs with generators and async functions. gh-107619: Extend functools LRU cache docs with generators and async functions Aug 14, 2023
@AA-Turner AA-Turner added needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Aug 14, 2023
@Hels15
Copy link
Contributor Author

Hels15 commented Aug 14, 2023

Accepted the suggested changes.

@Hels15
Copy link
Contributor Author

Hels15 commented Aug 14, 2023

Oh yes, you are right, I have added what you said.

@kumaraditya303 kumaraditya303 enabled auto-merge (squash) August 20, 2023 10:14
@kumaraditya303 kumaraditya303 merged commit 1a713ea into python:main Aug 20, 2023
@miss-islington
Copy link
Contributor

Thanks @Hels15 for the PR, and @kumaraditya303 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 20, 2023
…async functions (pythonGH-107934)

(cherry picked from commit 1a713ea)

Co-authored-by: Hadházy Tamás <[email protected]>
Co-authored-by: Adam Turner <[email protected]>
Co-authored-by: Kumar Aditya <[email protected]>
@bedevere-bot
Copy link

GH-108161 is a backport of this pull request to the 3.12 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.12 only security fixes label Aug 20, 2023
@bedevere-bot
Copy link

GH-108162 is a backport of this pull request to the 3.11 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Aug 20, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 20, 2023
…async functions (pythonGH-107934)

(cherry picked from commit 1a713ea)

Co-authored-by: Hadházy Tamás <[email protected]>
Co-authored-by: Adam Turner <[email protected]>
Co-authored-by: Kumar Aditya <[email protected]>
kumaraditya303 added a commit that referenced this pull request Aug 20, 2023
… async functions (GH-107934) (#108162)

gh-107619: Extend functools LRU cache docs with generators and async functions (GH-107934)
(cherry picked from commit 1a713ea)

Co-authored-by: Hadházy Tamás <[email protected]>
Co-authored-by: Adam Turner <[email protected]>
Co-authored-by: Kumar Aditya <[email protected]>
Yhg1s pushed a commit that referenced this pull request Aug 20, 2023
… async functions (GH-107934) (#108161)

gh-107619: Extend functools LRU cache docs with generators and async functions (GH-107934)
(cherry picked from commit 1a713ea)

Co-authored-by: Hadházy Tamás <[email protected]>
Co-authored-by: Adam Turner <[email protected]>
Co-authored-by: Kumar Aditya <[email protected]>
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.

6 participants