Title: agent: cache IO-intensive private helpers with @functools.cache and register in conftest · Issue #1806 · usethis-python/usethis-python · GitHub
Open Graph Title: agent: cache IO-intensive private helpers with @functools.cache and register in conftest · Issue #1806 · usethis-python/usethis-python
X Title: agent: cache IO-intensive private helpers with @functools.cache and register in conftest · Issue #1806 · usethis-python/usethis-python
Description: When adding a private helper function that performs file I/O (or other expensive operations) and is called multiple times per invocation, it should be decorated with @functools.cache to avoid redundant work.\n\nThe function _get_current_...
Open Graph Description: When adding a private helper function that performs file I/O (or other expensive operations) and is called multiple times per invocation, it should be decorated with @functools.cache to avoid redun...
X Description: When adding a private helper function that performs file I/O (or other expensive operations) and is called multiple times per invocation, it should be decorated with @functools.cache to avoid redun...
Opengraph URL: https://github.com/usethis-python/usethis-python/issues/1806
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"agent: cache IO-intensive private helpers with @functools.cache and register in conftest","articleBody":"When adding a private helper function that performs file I/O (or other expensive operations) and is called multiple times per invocation, it should be decorated with `@functools.cache` to avoid redundant work.\\n\\nThe function `_get_current_python_version()` in `src/usethis/_integrations/environ/python.py` was added without caching, even though it reads from disk and can be called up to three times per call to `get_supported_minor_python_versions()`.\\n\\nWhen applying `@functools.cache`, the function must also be added to the `clear_functools_caches` autouse fixture in `tests/conftest.py` so the cache is cleared between tests.\n\nWe should explain this in the agent skills","author":{"url":"https://github.com/nathanjmcdougall","@type":"Person","name":"nathanjmcdougall"},"datePublished":"2026-04-04T02:21:48.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/1806/usethis-python/issues/1806"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5478e6bd-d32b-b54e-cfb0-e2a8381c408b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B3CA:35FB06:55E256:74E794:6A4DA847 |
| html-safe-nonce | 61c5ca94b1cd3eddd0effb0ea82573859f649e7f2ed0a65d3d6b9a2e3d16517b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCM0NBOjM1RkIwNjo1NUUyNTY6NzRFNzk0OjZBNERBODQ3IiwidmlzaXRvcl9pZCI6IjQyODIwMjU3NTgxNjE3NDE4OTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | c78064113ab8d2bf5cbc663a4675fbacb46c2fab34e2cdf824922df36e279bb8 |
| hovercard-subject-tag | issue:4203013258 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/usethis-python/usethis-python/1806/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a2db6cbcbe1c07361de0f991d79ac027f478baa616a4ae7532d281c8a1a516b2/usethis-python/usethis-python/issues/1806 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a2db6cbcbe1c07361de0f991d79ac027f478baa616a4ae7532d281c8a1a516b2/usethis-python/usethis-python/issues/1806 |
| og:image:alt | When adding a private helper function that performs file I/O (or other expensive operations) and is called multiple times per invocation, it should be decorated with @functools.cache to avoid redun... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nathanjmcdougall |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33 |
| turbo-cache-control | no-preview |
| go-import | github.com/usethis-python/usethis-python git https://github.com/usethis-python/usethis-python.git |
| octolytics-dimension-user_id | 216362695 |
| octolytics-dimension-user_login | usethis-python |
| octolytics-dimension-repository_id | 842189705 |
| octolytics-dimension-repository_nwo | usethis-python/usethis-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 842189705 |
| octolytics-dimension-repository_network_root_nwo | usethis-python/usethis-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 47723578ce6819210724ef064c858fce6d3115a3 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width