Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions tests/cpydiff/core_class_setname.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""
categories: Core,Classes
description: ``__set_name__`` is not automatically called on applicable class members.
cause: MicroPython does not currently implement PEP 487.
workaround: Manually iterate through a class's ``__dict__`` and invoke ``__set_name__`` on its members after creating a class.
"""


class Descriptor:
def __set_name__(self, owner, name):
print(f"Descriptor.__set_name__({owner.__name__}, {name!r})")


class A:
x = Descriptor()
Loading