-
Notifications
You must be signed in to change notification settings - Fork 792
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
Rename PyObjectRef with PyAny #388
Conversation
As someone who doesn't really understand what I wonder if it might be a good idea to start by adding clear documentation about the difference between |
@pganssle I'm convinced that this is a better name and, in combination with more documentation, it will make more sense than For short, the new name means that from typing import List, Any
def foo(x: List, y: Any):
... translates into fn foo(x: &PyList, y: &PyAny) {
unimplemented!()
} |
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.
Big 👍
It should be replaced by
I like the idea, but that should be discussed separately. |
I'd say we wait a bit before merging so everyone has time to add comments. Oh, and @kngwyu could you please add a changelog entry? |
Yes, this is is a nice parallel, but this is very specific to the Python I haven't looked into this closely, but it may be worth considering other parts of the type system to see if the parallels break down. or if they hold up. What about I think in the end you should only adopt this |
As I've said in the issue thread,
I don't want to base pyo3 on typing, I just want to use the resemblance to make it easier understandable (I'd also say that "any" makes sense even without |
@pganssle So while renaming |
See #356 (comment) and around comments for the motivation.
Some related ideas:
FromPyObject
rather than renaming it? This trait remains unchanged and doesn't fit to our semanticsPyTryFrom
withPyDowncast
?