Author: Armin Rigo <[email protected]>
Branch: gc-del
Changeset: r63677:3cf9d416b252
Date: 2013-04-27 11:10 +0200
http://bitbucket.org/pypy/pypy/changeset/3cf9d416b252/

Log:    Document the limitations of __del__ methods.

diff --git a/pypy/doc/coding-guide.rst b/pypy/doc/coding-guide.rst
--- a/pypy/doc/coding-guide.rst
+++ b/pypy/doc/coding-guide.rst
@@ -347,7 +347,11 @@
 **objects**
 
   Normal rules apply. Special methods are not honoured, except ``__init__``,
-  ``__del__`` and ``__iter__``.
+  ``__del__`` and ``__iter__``.  The destructor ``__del__`` must only contain
+  `simple operations`__; for any kind of more complex destructor, see
+  ``rpython.rlib.rgc.register_finalizer()``.
+
+.. __: garbage_collection.html
 
 This layout makes the number of types to take care about quite limited.
 
diff --git a/pypy/doc/faq.rst b/pypy/doc/faq.rst
--- a/pypy/doc/faq.rst
+++ b/pypy/doc/faq.rst
@@ -247,9 +247,12 @@
 to mix types in arbitrary ways. RPython does not allow the binding of two
 different types in the same variable. In this respect (and in some others) it
 feels a bit like Java. Other features not allowed in RPython are the use of
-special methods (``__xxx__``) except ``__init__`` and ``__del__``, and the
+special methods (``__xxx__``) except ``__init__`` and ``__del__``
+(see `garbage collection`__), and the
 use of reflection capabilities (e.g. ``__dict__``).
 
+.. __: garbage_collection.html
+
 You cannot use most existing standard library modules from RPython.  The
 exceptions are
 some functions in ``os``, ``math`` and ``time`` that have native support.
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to