Commit Graph

30 Commits

Author SHA1 Message Date
Armin Rigo b9359c402b SF patch #1379023: document that a weakref callback is not invoked if the
weakref object itself is deleted first.
2005-12-29 17:43:08 +00:00
Georg Brandl 9a65d583ac Add doctest for examples in libweakref.tex to test_weakref. 2005-07-02 19:07:30 +00:00
Georg Brandl 376e6227b4 bug [ 1228904 ] weakref example broken 2005-07-02 10:44:32 +00:00
Fred Drake 0a4dd390bf Make weak references subclassable:
- weakref.ref and weakref.ReferenceType will become aliases for each
  other

- weakref.ref will be a modern, new-style class with proper __new__
  and __init__ methods

- weakref.WeakValueDictionary will have a lighter memory footprint,
  using a new weakref.ref subclass to associate the key with the
  value, allowing us to have only a single object of overhead for each
  dictionary entry (currently, there are 3 objects of overhead per
  entry: a weakref to the value, a weakref to the dictionary, and a
  function object used as a weakref callback; the weakref to the
  dictionary could be avoided without this change)

- a new macro, PyWeakref_CheckRefExact(), will be added

- PyWeakref_CheckRef() will check for subclasses of weakref.ref

This closes SF patch #983019.
2004-07-02 18:57:45 +00:00
Raymond Hettinger 34809170e5 Complete the list of weakreferencable objects. 2004-06-12 06:56:44 +00:00
Raymond Hettinger 027bb633b6 Add weakref support to sockets and re pattern objects. 2004-05-31 03:09:25 +00:00
Fred Drake 21ae4f983e minor markup adjustments 2004-02-03 20:55:15 +00:00
Fred Drake 4458ece4d7 Clarify minor point about the ref() and proxy() constructors.
This matches what is already documented for corresponding feature of the C API.
2004-02-03 19:44:26 +00:00
Fred Drake 42713109d9 use consistent email address for Tim 2003-12-30 16:15:35 +00:00
Martin v. Löwis ccabed35ee Patch #849350: Update to document bool return values. Backported to 2.3. 2003-11-27 19:48:03 +00:00
Tim Peters 5a5b243043 More words: gave more motivation, and added cautions about the special
dangers of trying to iterate over weak dicts.
2003-11-21 22:20:57 +00:00
Raymond Hettinger f8020e0211 Grammar nit. SF bug #757822 2003-07-02 15:10:38 +00:00
Raymond Hettinger 22c001bd29 Described responsibilty of weakly referenced extension types to initialize
the weakreflist to NULL in the constructor and to fill the tp_flags
slot with Py_TPFLAGS_HAVE_WEAKREFS.  Closes SF bug 586583.
2002-08-07 16:18:54 +00:00
Guido van Rossum 146483964e Patch supplied by Burton Radons for his own SF bug #487390: Modifying
type.__module__ behavior.

This adds the module name and a dot in front of the type name in every
type object initializer, except for built-in types (and those that
already had this).  Note that it touches lots of Mac modules -- I have
no way to test these but the changes look right.  Apologies if they're
not.  This also touches the weakref docs, which contains a sample type
object initializer.  It also touches the mmap test output, because the
mmap type's repr is included in that output.  It touches object.h to
put the correct description in a comment.
2001-12-08 18:02:58 +00:00
Fred Drake b03d0cc45e Typo, spotted by Detlef Lannert. 2001-11-26 21:39:40 +00:00
Fred Drake 7408da54e2 Many, many small fixes and improvements, most suggested by Detlef Lannert. 2001-10-26 17:40:22 +00:00
Fred Drake de3d060eb2 Typo: destuction --> destruction
Reported by Thomas Heller.
2001-10-26 11:27:54 +00:00
Fred Drake 3a2c462436 Minor textual adjustment, and style-guide conformance (no use of "iff"). 2001-10-26 03:00:39 +00:00
Fred Drake 8c2c3d301b Update the documentation to reflect the changes to ReferenceError. 2001-10-06 06:10:54 +00:00
Fred Drake 5d54879647 Fix some of the example code; the reference objects do not support a
get() method; just calling them is sufficient.  (There was a get() method
for this in an early version of the implementation.)

Reported by Mats Wichmann.
2001-08-03 03:50:28 +00:00
Fred Drake 0c209047ba Correct a markup error for an accented character.
Reported by Milan Zamazal <pdm@zamazal.org>.
2001-06-29 16:25:07 +00:00
Fred Drake f66cb5d0eb Corrected an error in the information on supporting weak references in
extension types (the docs reflected a development version of the API).

This closes SF bug #435066.
2001-06-22 17:20:29 +00:00
Fred Drake e7ec1efe50 Fix typo in weakref.proxy() documentation.
This closes SF bug #423087.
2001-05-10 17:22:17 +00:00
Fred Drake eedf985056 Include a synopsis for the chapter overview. 2001-04-11 19:17:11 +00:00
Fred Drake ac154a17a3 Remove the mapping() function from the documentation.
Add a description of the ReferenceError exception.
2001-04-10 19:57:58 +00:00
Fred Drake cb83988151 Added example use of weak references, contributed by Tim Peters. 2001-03-28 21:15:41 +00:00
Fred Drake 5e0dfaccd1 Update to the most recent weakref changes. 2001-03-23 04:36:02 +00:00
Martin v. Löwis 5e1633365d Patch #403985: Add support for weak-keyed dictionaries 2001-02-27 18:36:56 +00:00
Andrew M. Kuchling e7d7e6c879 Fix two typos 2001-02-14 02:39:11 +00:00
Fred Drake ebcf6a8573 Documentation for the weakref module. 2001-02-01 05:20:20 +00:00