A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2009-May/089541.html below:

[Python-Dev] special method lookup: how much do we care?

[Python-Dev] special method lookup: how much do we care?Daniel Stutzbach daniel at stutzbachenterprises.com
Sat May 9 02:36:44 CEST 2009
On Fri, May 8, 2009 at 6:14 PM, Benjamin Peterson <benjamin at python.org>wrote:

> Normally special methods use slots of the PyTypeObject struct.
> typeobject.c looks up all those methods on Python classes correctly.
> In the case of __enter__ and __exit__, the compiler generates bytecode
> to look them up, and that bytecode use PyObject_Getattr.


Would this problem apply to all special methods that don't use a slot in
PyTypeObject, then?  I know of several other examples:

__reduce__
__setstate__
__reversed__
__length_hint__
__sizeof__

(unless I misunderstand the definition of "special methods", which is
possible)

--
Daniel Stutzbach, Ph.D.
President, Stutzbach Enterprises, LLC <http://stutzbachenterprises.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20090508/ab0cc709/attachment.htm>
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4