[pypy-commit] pypy fix-bytearray-complexity: Document new magic method support

waedt noreply at buildbot.pypy.org
Mon Jun 9 17:17:47 CEST 2014


Author: Tyler Wade <wayedt at gmail.com>
Branch: fix-bytearray-complexity
Changeset: r72004:7faf6b6d4368
Date: 2014-06-09 10:16 -0500
http://bitbucket.org/pypy/pypy/changeset/7faf6b6d4368/

Log:	Document new magic method support

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
@@ -348,8 +348,11 @@
 
 **objects**
 
-  Normal rules apply. Special methods are not honoured, except ``__init__``,
-  ``__del__`` and ``__iter__``.
+  Normal rules apply. The only special methods that are honoured are
+  ``__init__``, ``__del__``, ``__len__``, ``__getitem__``, ``__setitem__``,
+  ``__getslice__``, ``__setslice__``, and ``__iter__``. To handle slicing,
+  ``__getslice__`` and ``__setslice__`` must be used; using ``__getitem__`` and
+   ``__setitem__`` for slicing isn't supported.
 
 This layout makes the number of types to take care about quite limited.
 


More information about the pypy-commit mailing list