GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add `platform.invalidate_caches` for invalidating cached results · Issue #122549 · python/cpython

Add platform.invalidate_caches for invalidating cached results #122549

New issue
Copy link
New issue
Copy link
Closed
Closed
Add platform.invalidate_caches for invalidating cached results#122549
Copy link
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement

Description

@picnixz
picnixz
opened on Aug 1, 2024
Issue body actions

Feature or enhancement

Proposal:

In #122525, it was observed that many functions of the platform module use cached results. This is, in practice, preferrable, but it should also be possible, if needed, to invalidate cached results. One use case is when the host name changes (i.e., one of the uname() components change).

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Linked PRs

  • gh-122549: Allow to invalidate platform's cached results #122547

Activity

  1. picnixz
    added
    type-featureA feature request or enhancementA feature request or enhancement
    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
    on Aug 1, 2024
  2. picnixz
    changed the title [-]Add `platform.invalidate_caches` for invalidating cached results (follow-up of #122525)[/-] [+]Add `platform.invalidate_caches` for invalidating cached results[/+] on Aug 1, 2024
  3. kashav commented on Aug 1, 2024

    @kashav
    kashav
    on Aug 1, 2024
    More actions

    One use case is when the host name changes (i.e., one of the uname() components change).

    Mostly out of curiosity - is there any way to watch for host name change?

  4. picnixz commented on Aug 1, 2024

    @picnixz
    picnixz
    on Aug 1, 2024
    MemberAuthor
    More actions

    Well.. you could have a task that runs every second and checks whether the host name changed or not. socket.gethostname gives you the runtime one, so you'll need to query it every second.

  5. vstinner
    added a commit that references this issue on Nov 15, 2024

    gh-122549: Add platform.invalidate_caches() (#122547)

    612ac28
  6. picnixz commented on Nov 15, 2024

    @picnixz
    picnixz
    on Nov 15, 2024
    MemberAuthor
    More actions

    Completed in 612ac28.

    Reacted by Victor Stinner
  7. picnixz
    closed this as completedon Nov 15, 2024
  8. picnixz
    added a commit that references this issue on Dec 8, 2024

    pythongh-122549: Add platform.invalidate_caches() (python#122547)

    4330cad
  9. ebonnal
    added a commit that references this issue on Jan 12, 2025

    pythongh-122549: Add platform.invalidate_caches() (python#122547)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.