Skip to content

Commit b203746

Browse files
committed
Using Sequence instead of list in Python type hints
1 parent a1be634 commit b203746

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

build.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,7 +1182,7 @@ fn pyi_generator(type_data: &[(String, String, Vec<Vec<String>>)]) -> io::Result
11821182
let mut file_contents = vec![
11831183
Cow::Borrowed("from __future__ import annotations"),
11841184
Cow::Borrowed(""),
1185-
Cow::Borrowed("from typing import Optional"),
1185+
Cow::Borrowed("from typing import Optional, Sequence"),
11861186
Cow::Borrowed(""),
11871187
Cow::Borrowed("__doc__: str"),
11881188
Cow::Borrowed("__version__: str"),
@@ -1261,8 +1261,8 @@ fn pyi_generator(type_data: &[(String, String, Vec<Vec<String>>)]) -> io::Result
12611261
.trim_end_matches('>')
12621262
.trim_end_matches('T');
12631263

1264-
python_types.push(format!("list[{type_name}]"));
1265-
file_contents.push(Cow::Owned(format!(" {variable_name}: list[{type_name}]")));
1264+
python_types.push(format!("Sequence[{type_name}]"));
1265+
file_contents.push(Cow::Owned(format!(" {variable_name}: Sequence[{type_name}]")));
12661266
} else if variable_type.starts_with("Option<") {
12671267
let type_name = variable_type
12681268
.trim_start_matches("Option<")

0 commit comments

Comments
 (0)