-
Notifications
You must be signed in to change notification settings - Fork 1.3k
derive(TryIntoPyStructSequence) #3613
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
Conversation
01ef615
to
7cd2b8b
Compare
5d810e4
to
899e794
Compare
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.
LGTM!
impl ::rustpython_vm::TryFromObject for #ty { | ||
fn try_from_object(vm: &::rustpython_vm::VirtualMachine, seq: ::rustpython_vm::PyObjectRef) -> ::rustpython_vm::PyResult<Self> { | ||
let seq = Self::try_elements_from(seq, vm)?; | ||
let mut iter = seq.into_iter(); |
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.
Yeah, this could probably be let seq: [PyObjectRef; <#ty as ::rustpython_vm::types::PyStructSeq>::FIELD_NAMES.len()] = seq.try_into().unwrap();
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.
no idea how to handle index in quote!()
899e794
to
41000c4
Compare
No description provided.