temporary
temporary
#
A throwaway scratch scoped to a with block: active inside, deleted on exit.
temporary(path=None, *, max_size_gb=None)
#
Open a throwaway scratch, active for the block and deleted on exit.
The scratch is active in the calling thread or task only: other threads keep the default, so a dry run in a worker never redirects live callers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path | None
|
Where to root the scratch. A fresh temp directory when omitted. |
None
|
max_size_gb
|
float | None
|
Hard cap on the cache's byte budget, in gigabytes. |
None
|
Yields:
| Type | Description |
|---|---|
Scratch
|
The temporary scratch handle (also installed as the active one). |