Python - Update pyo3 version

* Use __new__ instead of static method as model constructors
This commit is contained in:
Bjarte Johansen
2020-04-06 21:16:15 +02:00
parent 2a4e5f81de
commit 2dc48e56ac
10 changed files with 322 additions and 211 deletions

View File

@ -40,7 +40,7 @@ impl PySequenceProtocol for Encoding {
impl Encoding {
#[staticmethod]
#[args(growing_offsets = true)]
fn merge(encodings: Vec<&Encoding>, growing_offsets: bool) -> Encoding {
fn merge(encodings: Vec<PyRef<Encoding>>, growing_offsets: bool) -> Encoding {
Encoding::new(tk::tokenizer::Encoding::merge(
encodings
.into_iter()