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/2003-December/040719.html below:

[Python-Dev] are CObjects inherently unsafe?

[Python-Dev] are CObjects inherently unsafe? [Python-Dev] are CObjects inherently unsafe?Martin v. Löwis martin at v.loewis.de
Thu Dec 4 14:37:07 EST 2003
Michael Hudson <mwh at python.net> writes:

> It seems to me that it would be more sensible to have a dict mapping
> names (maybe just module names...) to cobjects in the interpreter
> state.  I guess there might be a way of getting ahold of the dict with
> the gc module (though I can't think of one off hand).  This wouldn't
> be a difficult change, and if the CObjects are left in the module
> dicts, it shouldn't even do that much damage to binary compatibility.
> 
> Thoughts?

Good idea. Alternatively, we could make "APIs" a feature of modules:
PyModule_GetAPI, PyModule_SetAPI. We would then define

typedef struct {
	PyObject_HEAD
	PyObject *md_dict;
        PyObject *md_api;
} PyModuleObject;

We could restrict md_api to CObjects, which, means we would not need
to change module_traverse.

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