Add pyperclip stubs - #13502
Merged
Merged
Add pyperclip stubs#13502
Conversation
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
Xiddoc
force-pushed
the
add-pyperclip-and-clipboard-stubs
branch
from
February 15, 2025 12:42
b387e6a to
2748860
Compare
This comment has been minimized.
This comment has been minimized.
Xiddoc
force-pushed
the
add-pyperclip-and-clipboard-stubs
branch
from
February 15, 2025 13:06
4d6203b to
360e2f1
Compare
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
Xiddoc
force-pushed
the
add-pyperclip-and-clipboard-stubs
branch
from
February 15, 2025 13:37
c83c29b to
e2fc504
Compare
This comment has been minimized.
This comment has been minimized.
Xiddoc
force-pushed
the
add-pyperclip-and-clipboard-stubs
branch
from
February 15, 2025 14:39
e2fc504 to
78bcdbf
Compare
This comment has been minimized.
This comment has been minimized.
Closed
Contributor
Author
|
I've separated |
Xiddoc
pushed a commit
to Xiddoc/typeshed
that referenced
this pull request
Feb 15, 2025
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
Akuli
reviewed
Feb 16, 2025
| def __call__(self, *args: Any) -> Any: ... | ||
|
|
||
| # Wrapper for ctypes calls, should not be exposed to the developer | ||
| class CheckedCall: |
Collaborator
There was a problem hiding this comment.
I think we should delete this from the stubs, because as the comment says, you shouldn't do from pyperclip import CheckedCall.
Contributor
Author
There was a problem hiding this comment.
Removed, thanks for the comment
| def copy(text: str) -> None: ... | ||
| def paste() -> str: ... | ||
| def set_clipboard(clipboard: _ClipboardMechanismName) -> None: ... | ||
| def determine_clipboard() -> tuple[_ClipboardCopyMechanism, _ClipboardPasteMechanism]: ... |
Collaborator
There was a problem hiding this comment.
There is also is_available(), and an example of using it in the module docstring:
Suggested change
| def determine_clipboard() -> tuple[_ClipboardCopyMechanism, _ClipboardPasteMechanism]: ... | |
| def determine_clipboard() -> tuple[_ClipboardCopyMechanism, _ClipboardPasteMechanism]: ... | |
| def is_available() -> bool: ... # undocumented |
Xiddoc
force-pushed
the
add-pyperclip-and-clipboard-stubs
branch
from
February 16, 2025 20:23
db8850d to
4350fd4
Compare
This comment has been minimized.
This comment has been minimized.
added 9 commits
February 16, 2025 22:35
Xiddoc
force-pushed
the
add-pyperclip-and-clipboard-stubs
branch
from
February 16, 2025 20:35
4350fd4 to
b6b1490
Compare
Contributor
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
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.
The
pypercliplibrary is a lovely package which exposes a simple API for interacting with the OS clipboard. It seems to be unfortunately unmaintained, and it doesn't seem like types will be added soon.The
clipboardlibrary is a re-package ofpyperclip, but with a more explicit name (it just exposes thepyperclipAPI).Both
clipboardandpyperclipamass almost 5 million downloads monthly. It's about time we give them proper typing.