Skip to content

Commit

Permalink
chore: fix tip format in output
Browse files Browse the repository at this point in the history
  • Loading branch information
Gowee committed Jun 22, 2023
1 parent 2fe4052 commit 77055f5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/target/python_class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ fn write_output(
}
if !imports_from_typing.is_empty() {
if imports_from_typing.contains("Union") {
writeln!(additional, "# 💡 Starting from Python 3.10 (PEP 604), `Union[A, B]` can be simplified as `A | B`\n")?;
writeln!(additional, "# 💡 Starting from Python 3.10 (PEP 604), `Union[A, B]` can be simplified as `A | B`
")?;
}
let typing_mod = if ["NotRequired", "Missing"]
.iter()
Expand All @@ -182,8 +183,9 @@ fn write_output(
writeln!(
additional,
r#"# 💡 `NotRequired` or `Missing` are introduced since Python 3.11 (PEP 655).
# `typing_extensions` is imported above for backwards compatibility.
# For Python < 3.11, pip install typing_extensions. O.W., just change it to `typing`\n"#
# `typing_extensions` is imported above for backwards compatibility.
# For Python < 3.11, pip install typing_extensions. O.W., just change it to `typing`
"#
)?;
"typing_extensions"
} else {
Expand Down

0 comments on commit 77055f5

Please sign in to comment.