-
-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add stubtest, fix incorrect stubs #73
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,165 @@ | ||
# not present at runtime (but maybe should be?) | ||
trio.AsyncBinaryIO | ||
trio.AsyncBufferedFileIO | ||
trio.AsyncFileIO | ||
trio.AsyncIO | ||
trio.AsyncTextFileIO | ||
trio.AsyncTextIO | ||
trio.NoHandshakeError | ||
trio.SSLStream.cipher | ||
trio.SSLStream.compression | ||
trio.SSLStream.get_channel_binding | ||
trio.SSLStream.getpeercert | ||
trio.SSLStream.pending | ||
trio.SSLStream.selected_alpn_protocol | ||
trio.SSLStream.selected_npn_protocol | ||
trio.SSLStream.session | ||
trio.SSLStream.session_reused | ||
trio.SSLStream.shared_ciphers | ||
trio.lowlevel.WaitForSingleObject | ||
trio.socket.AF_AAL5 | ||
trio.socket.AF_BLUETOOTH | ||
trio.socket.AF_DECnet | ||
trio.socket.AF_LINK | ||
trio.socket.AF_SYSTEM | ||
trio.socket.AI_DEFAULT | ||
trio.socket.AI_MASK | ||
trio.socket.AI_V4MAPPED_CFG | ||
trio.socket.EAGAIN | ||
trio.socket.EAI_BADHINTS | ||
trio.socket.EAI_MAX | ||
trio.socket.EAI_PROTOCOL | ||
trio.socket.IPPROTO_BIP | ||
trio.socket.IPPROTO_EON | ||
trio.socket.IPPROTO_GGP | ||
trio.socket.IPPROTO_HELLO | ||
trio.socket.IPPROTO_IPCOMP | ||
trio.socket.IPPROTO_IPV4 | ||
trio.socket.IPPROTO_MAX | ||
trio.socket.IPPROTO_MOBILE | ||
trio.socket.IPPROTO_ND | ||
trio.socket.IPPROTO_VRRP | ||
trio.socket.IPPROTO_XTP | ||
trio.socket.IPV6_USE_MIN_MTU | ||
trio.socket.IPX_TYPE | ||
trio.socket.IP_RECVDSTADDR | ||
trio.socket.LOCAL_PEERCRED | ||
trio.socket.MSG_BCAST | ||
trio.socket.MSG_BTAG | ||
trio.socket.MSG_EOF | ||
trio.socket.MSG_ETAG | ||
trio.socket.MSG_MCAST | ||
trio.socket.MSG_NOTIFICATION | ||
trio.socket.RDS_CANCEL_SENT_TO | ||
trio.socket.RDS_CMSG_RDMA_ARGS | ||
trio.socket.RDS_CMSG_RDMA_DEST | ||
trio.socket.RDS_CMSG_RDMA_MAP | ||
trio.socket.RDS_CMSG_RDMA_STATUS | ||
trio.socket.RDS_CMSG_RDMA_UPDATE | ||
trio.socket.RDS_CONG_MONITOR | ||
trio.socket.RDS_FREE_MR | ||
trio.socket.RDS_GET_MR | ||
trio.socket.RDS_GET_MR_FOR_DEST | ||
trio.socket.RDS_RDMA_DONTWAIT | ||
trio.socket.RDS_RDMA_FENCE | ||
trio.socket.RDS_RDMA_INVALIDATE | ||
trio.socket.RDS_RDMA_NOTIFY_ME | ||
trio.socket.RDS_RDMA_READWRITE | ||
trio.socket.RDS_RDMA_SILENT | ||
trio.socket.RDS_RDMA_USE_ONCE | ||
trio.socket.RDS_RECVERR | ||
trio.socket.SCM_CREDS | ||
trio.socket.SOL_ATALK | ||
trio.socket.SOL_AX25 | ||
trio.socket.SOL_HCI | ||
trio.socket.SOL_IPX | ||
trio.socket.SOL_NETROM | ||
trio.socket.SOL_ROSE | ||
trio.socket.SO_EXCLUSIVEADDRUSE | ||
trio.socket.SO_SETFIB | ||
trio.socket.SO_USELOOPBACK | ||
trio.socket.SocketType.__enter__ | ||
trio.socket.SocketType.__exit__ | ||
trio.socket.SocketType.accept | ||
trio.socket.SocketType.bind | ||
trio.socket.SocketType.close | ||
trio.socket.SocketType.connect | ||
trio.socket.SocketType.detach | ||
trio.socket.SocketType.dup | ||
trio.socket.SocketType.fileno | ||
trio.socket.SocketType.get_inheritable | ||
trio.socket.SocketType.getpeername | ||
trio.socket.SocketType.getsockname | ||
trio.socket.SocketType.getsockopt | ||
trio.socket.SocketType.is_readable | ||
trio.socket.SocketType.listen | ||
trio.socket.SocketType.recv | ||
trio.socket.SocketType.recv_into | ||
trio.socket.SocketType.recvfrom | ||
trio.socket.SocketType.recvfrom_into | ||
trio.socket.SocketType.recvmsg | ||
trio.socket.SocketType.recvmsg_into | ||
trio.socket.SocketType.send | ||
trio.socket.SocketType.sendmsg | ||
trio.socket.SocketType.sendto | ||
trio.socket.SocketType.set_inheritable | ||
trio.socket.SocketType.setsockopt | ||
trio.socket.SocketType.share | ||
trio.socket.SocketType.shutdown | ||
trio.socket.SocketType.wait_writable | ||
trio.socket.fromshare | ||
trio.socket.ntohl | ||
|
||
# Not present in stub (but maybe should be?) | ||
trio.DTLSChannel | ||
trio.DTLSEndpoint | ||
trio.MultiError.derive | ||
trio.NeedHandshakeError | ||
trio.Path.hardlink_to | ||
trio.Path.is_mount | ||
trio.Path.link_to | ||
trio.Path.readlink | ||
trio.Process.encoding | ||
trio.Process.errors | ||
trio.Process.universal_newlines | ||
trio.TrioDeprecationWarning | ||
trio.lowlevel.FdStream.close | ||
trio.lowlevel.open_process | ||
|
||
# NoPublicConstructor | ||
trio.MemoryReceiveChannel.__init__ | ||
trio.MemorySendChannel.__init__ | ||
trio.Nursery.__init__ | ||
trio.Process.__init__ | ||
trio.lowlevel.Task.__init__ | ||
trio.lowlevel.TrioToken.__init__ | ||
|
||
# wraps pathlib.Path, so arg inspection fails | ||
# should maybe list all of them | ||
trio.Path.__init__ | ||
trio.Path.absolute | ||
trio.Path.cwd | ||
trio.Path.exists | ||
trio.Path.expanduser | ||
trio.Path.group | ||
trio.Path.home | ||
trio.Path.is_block_device | ||
trio.Path.is_char_device | ||
trio.Path.is_dir | ||
trio.Path.is_fifo | ||
trio.Path.is_file | ||
trio.Path.is_socket | ||
trio.Path.is_symlink | ||
trio.Path.iterdir | ||
trio.Path.lstat | ||
trio.Path.owner | ||
trio.Path.read_bytes | ||
trio.Path.rmdir | ||
trio.Path.stat | ||
trio.Path.unlink | ||
|
||
# magic special case function | ||
trio.run_process | ||
|
||
# written as a class so you can say open_memory_channel[int](5) | ||
trio.open_memory_channel |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably better to not expose this param in stubs, since it's got a leading underscore and use of
MultiError
is deprecated anyway!There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, it is just a stub - and not an official API/documentation. If there weren't a stub file, type checkers would see the parameters, and in error messages and the like you could see references to it. So I think I'm leaning towards keeping it.
I think having fewer lines in the allowlist also is a good thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant "have a stub for MultiError, which omits the
_collapse
parameter", I think we agree on the first part but I miscommunicated about the second?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah no that's how I interpreted you 😅 So the miscommunication must be on my part! :D
I think adding
trio.MultiError.__init__
andtrio.MultiError.__new__
toallowlist.txt
isn't great. Another reason for keeping the stubs technically correct is to ease a transition away from having separate stub files at all, and if exposing_collapse
is bad for some reason that should be addressed intrio
- rather than hidden by having an "incorrect" type for the function in the stub.