Skip to content

Commit e2d42bf

Browse files
committed
fix: typing.Any is not imported for List[Any] (close #3)
1 parent b80e2ce commit e2d42bf

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/target/python_class.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,11 @@ fn write_output(
146146
);
147147
}
148148
}
149-
Type::Array(_) => {
149+
Type::Array(inner) => {
150150
imports_from_typing.insert("List");
151+
if schema.arena.get(inner).unwrap().is_any() {
152+
imports_from_typing.insert("Any");
153+
}
151154
}
152155
_ => {}
153156
}

src/target/python_inline.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,11 @@ fn write_output(
139139
});
140140
}
141141
}
142-
Type::Array(_) => {
142+
Type::Array(inner) => {
143143
imports_from_typing.insert("List");
144+
if schema.arena.get(inner).unwrap().is_any() {
145+
imports_from_typing.insert("Any");
146+
}
144147
}
145148
_ => {}
146149
}

0 commit comments

Comments
 (0)