Skip to content
Myr

Merge pull request #1087 from sirosen/docs/lazy-readmode

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Clarify the "lazy" File behaviors

authored by David Lord · committed by GitHub · parents 7463db5, db90967 · Browse files · 1 file+6 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−3 removed

  • other:+6 added−3 removed

1 file+6 added−3 removed

modified:click/types.py+6 added-3 removed
329 unmodified lines
330 By default, the file is opened for reading text data, but it can also be331 opened in binary mode or for writing. The encoding parameter can be used332 to force a specific encoding.333334 The `lazy` flag controls if the file should be opened immediately or335 upon first IO. The default is to be non lazy for standard input and336 output streams as well as files opened for reading, lazy otherwise.334 The `lazy` flag controls if the file should be opened immediately or upon335 first IO. The default is to be non-lazy for standard input and output336 streams as well as files opened for reading, `lazy` otherwise. When opening a337 file lazily for reading, it is still opened temporarily for validation, but338 will not be held open until first IO. lazy is mainly useful when opening339 for writing to avoid creating the file until it is needed.340341 Starting with Click 2.0, files can also be opened atomically in which342 case all writes go into a separate file in the same folder and upon343 completion the file will be moved over to the original location. This
270 unmodified lines