pyo3 v0.18 migration (#1173)

* pyo v0.18 migration

* Fix formatting issues of black
This commit is contained in:
mert-kurttutan
2023-03-08 11:27:47 +01:00
committed by GitHub
parent 3138657565
commit 5c18ec5ff5
15 changed files with 138 additions and 82 deletions

View File

@ -267,12 +267,12 @@ impl PyBertNormalizer {
}
#[new]
#[args(
clean_text = "true",
handle_chinese_chars = "true",
strip_accents = "None",
lowercase = "true"
)]
#[pyo3(signature = (
clean_text = true,
handle_chinese_chars = true,
strip_accents = None,
lowercase = true
))]
fn new(
clean_text: bool,
handle_chinese_chars: bool,
@ -407,7 +407,7 @@ impl PyStrip {
}
#[new]
#[args(left = "true", right = "true")]
#[pyo3(signature = (left = true, right = true))]
fn new(left: bool, right: bool) -> (Self, PyNormalizer) {
(PyStrip {}, Strip::new(left, right).into())
}