forked from Rust-related/RustPython
Rename PyTypeFlags::METHOD_{DESCR => DESCRIPTOR}
This commit is contained in:
@@ -104,7 +104,7 @@ impl PyMethodDescriptor {
|
||||
|
||||
#[pyclass(
|
||||
with(GetDescriptor, Callable, Constructor, Representable),
|
||||
flags(METHOD_DESCR)
|
||||
flags(METHOD_DESCRIPTOR)
|
||||
)]
|
||||
impl PyMethodDescriptor {
|
||||
#[pygetset(magic)]
|
||||
|
||||
@@ -350,7 +350,7 @@ impl PyPayload for PyFunction {
|
||||
|
||||
#[pyclass(
|
||||
with(GetDescriptor, Callable, Representable),
|
||||
flags(HAS_DICT, METHOD_DESCR)
|
||||
flags(HAS_DICT, METHOD_DESCRIPTOR)
|
||||
)]
|
||||
impl PyFunction {
|
||||
#[pygetset(magic)]
|
||||
|
||||
@@ -123,7 +123,7 @@ bitflags! {
|
||||
const IMMUTABLETYPE = 1 << 8;
|
||||
const HEAPTYPE = 1 << 9;
|
||||
const BASETYPE = 1 << 10;
|
||||
const METHOD_DESCR = 1 << 17;
|
||||
const METHOD_DESCRIPTOR = 1 << 17;
|
||||
const HAS_DICT = 1 << 40;
|
||||
|
||||
#[cfg(debug_assertions)]
|
||||
|
||||
@@ -33,7 +33,11 @@ impl PyMethod {
|
||||
let cls_attr = match interned_name.and_then(|name| cls.get_attr(name)) {
|
||||
Some(descr) => {
|
||||
let descr_cls = descr.class();
|
||||
let descr_get = if descr_cls.slots.flags.has_feature(PyTypeFlags::METHOD_DESCR) {
|
||||
let descr_get = if descr_cls
|
||||
.slots
|
||||
.flags
|
||||
.has_feature(PyTypeFlags::METHOD_DESCRIPTOR)
|
||||
{
|
||||
is_method = true;
|
||||
None
|
||||
} else {
|
||||
@@ -106,7 +110,7 @@ impl PyMethod {
|
||||
.class()
|
||||
.slots
|
||||
.flags
|
||||
.has_feature(PyTypeFlags::METHOD_DESCR)
|
||||
.has_feature(PyTypeFlags::METHOD_DESCRIPTOR)
|
||||
{
|
||||
Self::Function {
|
||||
target: obj.to_owned(),
|
||||
|
||||
Reference in New Issue
Block a user