Repository navigation
Replace click LazyFile with a custom type - #716
Merged
Merged
Conversation
sirosen
force-pushed
the
click-85-compat
branch
2 times, most recently
from
September 18, 2026 23:58
46eda0b to
d8562be
Compare
Heavily inspired by looking at click.utils._LazyFile to see how it behaves, create a "binary input" type, which acts as a BinaryIO and otherwise does relatively little. The param type which wraps it is responsible for attaching it appropriately to the click Context.
This may be a matter of `click-type-test` being out of sync with the latest `click` release, but it flags these as `bool | None` unless explicit defaults are set. Co-authored-by: Edgar Ramírez Mondragón <16805946+edgarrmondragon@users.noreply.github.com>
sirosen
force-pushed
the
click-85-compat
branch
from
September 19, 2026 00:10
d8562be to
bb95d07
Compare
- Rename the open handle property to an `open()` method, to ensure that it has an `open()` method -- though not part of the target interface, this is a common expectation around handling binary streams - Use ABC `register()` to make sure that the class passes isinstance() checks even though it does not subclass/inherit
sirosen
force-pushed
the
click-85-compat
branch
from
September 19, 2026 02:14
e7242a7 to
f017f4e
Compare
This was referenced Sep 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Heavily inspired by looking at click.utils._LazyFile to see how it
behaves, create a "binary input" type, which acts as a BinaryIO and
otherwise does relatively little. The param type which wraps it is
responsible for attaching it appropriately to the click Context.