Commit Graph

55 Commits

Author SHA1 Message Date
Daniel Fortunov
1642c0ef75 bpo-40895: Update weakref documentation to remove old warnings (GH-20687)
The doccumentation at https://docs.python.org/3.10/library/weakref.html cautions that the `WeakKeyDictionary` and `WeakValueDictionary` are susceptible to the problem of dictionary mutation during iteration.

These notes present the user with a problem that has no easy solution.

I dug into the implementation and found that fortunately, Antoine Pitrou already addressed this challenge (10 years ago!) by introducing an `_IterationGuard` context manager to the implementation, which delays mutation while an iteration is in progress.

I asked for confirmation and @pitrou agreed that these notes could be removed:
c1baa601e2 (commitcomment-39514438)
2020-06-10 13:26:49 -07:00
Curtis Bucher
8f1ed21ecf bpo-36144: Add union operators to WeakValueDictionary584 (#19127) 2020-03-24 18:51:29 -07:00
Curtis Bucher
25e580a73c bpo-36144: Add union operators to WeakKeyDictionary (#19106) 2020-03-23 13:49:46 -07:00
Roger Hurwitz
4eb9f4313c bpo-38374: Remove weakref.ReferenceError from docs (GH-18452)
Reflecting changes to the code, removed weakref.ReferenceError from weakref.rst and exceptions.rst.

Issue submitter provided evidence that the `weakref.ReferenceError` alias for `ReferenceError` was removed from the code in 2007.  Working with @gvanrossum at PyCascades CPython sprint we looked at the code and confirmed that `weakref.ReferenceError` was no longer in `weakref.py`.

Based on that analysis I removed references `weakref.ReferenceError` from the two documents where it was still being referenced: `weakref.rst` and `exceptions.rst`. 


https://bugs.python.org/issue38374
2020-02-10 22:56:02 -08:00
Géry Ogam
f475729a71 Update weakref.rst (GH-14098) 2019-06-15 04:33:23 -07:00
Serhiy Storchaka
142566c028 [3.9] bpo-37116: Use PEP 570 syntax for positional-only parameters. (GH-12620)
Turn deprecation warnings added in 3.8 into TypeError.
2019-06-05 18:22:31 +03:00
Serhiy Storchaka
2085bd0877 bpo-37116: Use PEP 570 syntax for positional-only parameters. (GH-13700) 2019-06-01 11:00:15 +03:00
Mark Dickinson
7abb6c05af bpo-36669: add matmul support to weakref.proxy (GH-12932) 2019-04-26 15:56:15 +09:00
Inada Naoki
b3c92c6ae9 bpo-36597: fix weakref example code (GH-12779)
Commit 57b1a2862 fixed doctest, but example code is not
match with document.
Just skip doctest for the block.
2019-04-11 19:05:32 +09:00
Inada Naoki
57b1a2862a bpo-36597: fix random doctest failure (GH-12776) 2019-04-11 17:53:49 +09:00
Marco Buttu
7b2491a6aa bpo-27200: Fix pathlib, ssl, turtle and weakref doctests (GH-616) 2017-04-13 17:17:59 +03:00
Mariatta
3110a379bb bpo-29474: Improve documentation for weakref.WeakValueDictionary (#10)
There were some grammatical errors in weakref.WeakValueDictionary
documentation.
2017-02-12 08:17:50 -08:00
Martin Panter
0f0eac431f Issue #27993: Fix problems with plural objects in docs and comments 2016-09-07 11:04:41 +00:00
Terry Jan Reedy
fa089b9b0b Issue #22558: Add remaining doc links to source code for Python-coded modules.
Reformat header above separator line (added if missing) to a common format.
Patch by Yoni Lavi.
2016-06-11 15:02:54 -04:00
Serhiy Storchaka
e4ba872543 Remove redundant leading zeroes in PEP references. 2016-03-31 15:30:54 +03:00
Antoine Pitrou
5db1bb81ff Issue #22696: Add function :func:sys.is_finalizing to know about interpreter shutdown. 2014-12-07 01:28:27 +01:00
Donald Stufft
8b852f111e Fix Issue #21528 - Fix documentation typos 2014-05-20 12:58:38 -04:00
R David Murray
a101bdb88c whatsnew: ssl getpeercert/do_handshake raise OSError, weakref __callback__.
Also add a missing word to gc entry, and delete a now-obsolete doc note
in the weakref __callback__ docs.  (Opened an issue for rewriting
the section that compares finalizers and __del__ method.)
2014-01-06 16:32:05 -05:00
Nick Coghlan
4c7fe6a5ad Avoid inconsistent use of 'finalizer' 2013-09-22 21:32:12 +10:00
Nick Coghlan
be57ab8a34 Close #19047: weakref doc cleanups
- be clear finalizers survive automatically
- update for PEP 442 __del__ changes
- mention module cleanup changes and weakref.finalize in What's New
2013-09-22 21:26:30 +10:00
Antoine Pitrou
796564c27b Issue #18112: PEP 442 implementation (safe object finalization). 2013-07-30 19:59:21 +02:00
Richard Oudkerk
7a3dae056d Issue #15528: Add weakref.finalize to support finalization using
weakref callbacks.

This is 2e446e87ac5b except that collections/__init__.py has been
modified to import proxy from _weakref instead of weakref.  This
eliminates an import cycle which seems to cause a problem on Unix but
not Windows.
2013-05-05 23:05:00 +01:00
Richard Oudkerk
39b17c513a Backout 2e446e87ac5b; it breaks the unix buildbots. 2013-05-05 22:12:34 +01:00
Richard Oudkerk
f3593026de Issue #15528: Add weakref.finalize to support finalization using
weakref callbacks.
2013-05-05 20:59:04 +01:00
Mark Dickinson
9b6fdf8401 Fix incorrect indentation on 'versionadded' for weakref.ref.__callback__. 2013-04-13 16:09:18 +01:00