pymethods: disable protocols with multiple-pymethods for now

This commit is contained in:
David Hewitt 2021-09-18 13:08:24 +01:00
parent a551b005b4
commit 592c98c722
3 changed files with 12 additions and 1 deletions

View File

@ -464,6 +464,13 @@ fn impl_class(
),
};
let methods_protos = match methods_type {
PyClassMethodsType::Specialization => {
Some(quote! { visitor(collector.methods_protocol_slots()); })
}
PyClassMethodsType::Inventory => None,
};
let base = &attr.base;
let base_nativetype = if attr.has_extends {
quote! { <Self::BaseType as ::pyo3::class::impl_::PyClassBaseType>::BaseNativeType }
@ -591,7 +598,7 @@ fn impl_class(
visitor(collector.sequence_protocol_slots());
visitor(collector.async_protocol_slots());
visitor(collector.buffer_protocol_slots());
visitor(collector.methods_protocol_slots());
#methods_protos
}
fn get_buffer() -> ::std::option::Option<&'static ::pyo3::class::impl_::PyBufferProcs> {

View File

@ -1,3 +1,5 @@
#![cfg(not(feature = "multiple-pymethods"))]
use pyo3::class::basic::CompareOp;
use pyo3::prelude::*;
use pyo3::py_run;

View File

@ -1,3 +1,5 @@
#![cfg(not(feature = "multiple-pymethods"))]
use pyo3::exceptions::PyValueError;
use pyo3::types::{PySlice, PyType};
use pyo3::{basic::CompareOp, exceptions::PyAttributeError, prelude::*};