We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 756ef43 commit d2e33d9Copy full SHA for d2e33d9
exercises/01_intro/05_gil/src/lib.rs
@@ -1,10 +1,13 @@
1
-use pyo3::prelude::*;
+use pyo3::{prelude::*, types::PyList};
2
3
#[pyfunction]
4
// TODO: Use `PyList` instead of `Vec<u64>` as the input type. Panic on errors, for now.
5
// You might find this useful: https://pyo3.rs/v0.22.0/conversions/traits#extract-and-the-frompyobject-trait
6
-fn print_number_list() {
7
- todo!()
+fn print_number_list(numbers: Bound<'_, PyList>) {
+ for num_obj in numbers {
8
+ let num: u64 = num_obj.extract().unwrap();
9
+ println!("{num}")
10
+ }
11
}
12
13
#[pymodule]
0 commit comments