diff --git a/crates/red_knot_python_semantic/resources/mdtest/call/methods.md b/crates/red_knot_python_semantic/resources/mdtest/call/methods.md index 6aec3e68a9..8750030498 100644 --- a/crates/red_knot_python_semantic/resources/mdtest/call/methods.md +++ b/crates/red_knot_python_semantic/resources/mdtest/call/methods.md @@ -23,8 +23,8 @@ object (in which case it is `None`), or from an instance (in which case it is th - `C().f` is equivalent to `getattr_static(C, "f").__get__(C(), C)` Here, `inspect.getattr_static` is used to bypass the descriptor protocol and directly access the -function attribute. The way the special `__get__` method *on functions* works like is as follows. In -the former case, if the `instance` attribute is `None`, it simply returns the function itself. In +function attribute. The way the special `__get__` method *on functions* works is as follows. In the +former case, if the `instance` argument is `None`, `__get__` simply returns the function itself. In the latter case, it returns a *bound method* object: ```py diff --git a/crates/red_knot_python_semantic/resources/mdtest/descriptor_protocol.md b/crates/red_knot_python_semantic/resources/mdtest/descriptor_protocol.md index 4206440039..e01fad98aa 100644 --- a/crates/red_knot_python_semantic/resources/mdtest/descriptor_protocol.md +++ b/crates/red_knot_python_semantic/resources/mdtest/descriptor_protocol.md @@ -83,9 +83,11 @@ reveal_type(c.flexible_int) # revealed: int | None ## Data and non-data descriptors -Descriptors that define `__set__` or `__delete__` are called *data descriptors* (e.g. properties), -while those that only define `__get__` are called non-data descriptors (e.g. functions, -`classmethod` or `staticmethod`). +Descriptors that define `__set__` or `__delete__` are called *data descriptors*. An example\ +of a data descriptor is a `property` with a setter and/or a deleter.\ +Descriptors that only define `__get__`, meanwhile, are called *non-data descriptors*. Examples +include\ +functions, `classmethod` or `staticmethod`). The precedence chain for attribute access is (1) data descriptors, (2) instance attributes, and (3) non-data descriptors.