Rename PyTypeFlags::METHOD_{DESCR => DESCRIPTOR}

This commit is contained in:
Jeong YunWon
2023-04-30 17:33:28 +09:00
parent 98eef0804e
commit e73603945d
4 changed files with 9 additions and 5 deletions

View File

@@ -104,7 +104,7 @@ impl PyMethodDescriptor {
#[pyclass(
with(GetDescriptor, Callable, Constructor, Representable),
flags(METHOD_DESCR)
flags(METHOD_DESCRIPTOR)
)]
impl PyMethodDescriptor {
#[pygetset(magic)]

View File

@@ -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)]

View File

@@ -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)]

View File

@@ -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(),