Skip to content

Commit 1909b6d

Browse files
Add side effect note; apply review suggestions for test
Co-authored-by: Jelle Zijlstra <[email protected]>
1 parent 699ea77 commit 1909b6d

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

Doc/whatsnew/3.15.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ Other language changes
207207
* The :attr:`~object.__dict__` and :attr:`!__weakref__` descriptors now use a
208208
single descriptor instance per interpreter, shared across all types that
209209
need them.
210+
This speeds up class creation, and helps avoid reference cycles.
210211
(Contributed by Petr Viktorin in :gh:`135228`.)
211212

212213

Lib/test/test_descr.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6070,11 +6070,11 @@ class IntSubclass(int):
60706070
None,
60716071
)
60726072
with self.assertRaises(AttributeError):
6073-
print(weakref_descriptor.__get__(True, bool))
6073+
weakref_descriptor.__get__(True, bool)
60746074
with self.assertRaises(AttributeError):
6075-
print(weakref_descriptor.__get__(SlotClass(), SlotClass))
6075+
weakref_descriptor.__get__(SlotClass(), SlotClass)
60766076
with self.assertRaises(AttributeError):
6077-
print(weakref_descriptor.__get__(IntSubclass(), IntSubclass))
6077+
weakref_descriptor.__get__(IntSubclass(), IntSubclass)
60786078

60796079

60806080
if __name__ == "__main__":
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
The :attr:`object.__dict__` and :attr:`!__weakref__` descriptors now use a
22
single descriptor instance per interpreter, shared across all types that
33
need them.
4+
This speeds up class creation, and helps avoid reference cycles.

0 commit comments

Comments
 (0)