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/2012-May/119485.html below:

[Python-Dev] C-level duck typing

[Python-Dev] C-level duck typing [Python-Dev] C-level duck typing"Martin v. Löwis" martin at v.loewis.de
Wed May 16 10:36:03 CEST 2012
 > And, we want this to somehow work with existing Python; we still
 > support users on Python 2.4.

This makes the question out-of-scope for python-dev - we only discuss
new versions of Python here. Old versions cannot be developed anymore
(as they are released already).

> typedef struct {
> unsigned long extension_id;
> void *data;
> } PyTypeObjectExtensionEntry;
>
> and then a type object can (somehow!) point to an array of these. The
> array is linearly scanned

It's unclear to me why you think that a linear scan is faster than
a dictionary lookup. The contrary will be the case - the dictionary
lookup (PyObject_GetAttr) will be much faster.

Just make sure to use interned strings, and to cache the interned strings.

Regards,
Martin

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