Skip to content

Commit dbca2d7

Browse files
authored
Add __set_name__ method to property (#16804)
__set_name__ is a built-in method of the property built-in, present from 3.10+
1 parent 983d92a commit dbca2d7

2 files changed

Lines changed: 1 addition & 1 deletion

File tree

‎stdlib/@tests/stubtest_allowlists/common.txt‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ asyncio.locks.Condition.locked
193193
asyncio.locks.Condition.release
194194

195195
builtins.memoryview.__contains__ # C type that implements __getitem__
196-
builtins.property.__set_name__ # Doesn't actually exist
197196
builtins.reveal_locals # Builtins that type checkers pretends exist
198197
builtins.reveal_type # Builtins that type checkers pretends exist
199198

‎stdlib/builtins.pyi‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1625,6 +1625,7 @@ class property:
16251625
fdel: Callable[[Any], None] | None = None,
16261626
doc: str | None = None,
16271627
) -> None: ...
1628+
def __set_name__(self, owner: type, name: str, /) -> None: ...
16281629
def getter(self, fget: Callable[[Any], Any], /) -> property: ...
16291630
def setter(self, fset: Callable[[Any, Any], None], /) -> property: ...
16301631
def deleter(self, fdel: Callable[[Any], None], /) -> property: ...

0 commit comments

Comments
 (0)