You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add platform.invalidate_caches for invalidating cached results #122549
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).
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
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.
Activity
[-]Add `platform.invalidate_caches` for invalidating cached results (follow-up of #122525)[/-][+]Add `platform.invalidate_caches` for invalidating cached results[/+]kashav commentedon Aug 1, 2024
Mostly out of curiosity - is there any way to watch for host name change?
picnixz commentedon Aug 1, 2024
Well.. you could have a task that runs every second and checks whether the host name changed or not.
socket.gethostnamegives you the runtime one, so you'll need to query it every second.gh-122549: Add platform.invalidate_caches() (#122547)
picnixz commentedon Nov 15, 2024
Completed in 612ac28.
pythongh-122549: Add platform.invalidate_caches() (python#122547)
pythongh-122549: Add platform.invalidate_caches() (python#122547)