| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…kx-return-type-annotations-from-python-type-stubs
…' of https://github.com/Avasam/typeshed into networkx-return-type-annotations-from-python-type-stubs
There was a problem hiding this comment.
Just two small remarks below.
Sorry, something went wrong.
| def write_edgelist(G, path, comments: str = "#", delimiter: str = " ", data: bool = True, encoding: str = "utf-8") -> None: ... | ||
| @_dispatchable | ||
| def generate_edgelist(G, delimiter: str = " ", data: bool = True) -> Generator[Incomplete, None, None]: ... | ||
| def generate_edgelist(G, delimiter: str = " ", data: bool = True) -> Generator[str, None, None]: ... |
There was a problem hiding this comment.
Nitty nit:
| def generate_edgelist(G, delimiter: str = " ", data: bool = True) -> Generator[str, None, None]: ... | |
| def generate_edgelist(G, delimiter: str = " ", data: bool = True) -> Generator[str]: ... |
Sorry, something went wrong.
There was a problem hiding this comment.
(applied suggestion)
There's a ton of those in networkx stubs. Maybe we should have a lint rule for the new concise Generator format ?
Sorry, something went wrong.
| weight: str | None = "weight", | ||
| format="csr", | ||
| ): ... | ||
| ): ... # Return is a complex union of scipy classes depending on the format param |
There was a problem hiding this comment.
So, should we return Any?
| ): ... # Return is a complex union of scipy classes depending on the format param | |
| ) -> Any: ... # Return is a complex union of scipy classes depending on the format param |
Sorry, something went wrong.
There was a problem hiding this comment.
I think I added this comment initially because I probably added Any as well, but I think you could actually represent the return type with overloads based on the format param. So it's more "incomplete", than "unrepresentable".
Sorry, something went wrong.
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Extracted from #14038
Return types are a lot more straightforward to validate. So I extracted them in their own PR to reduce the size of #14038