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-April/088067.html below:

[Python-Dev] Let's update CObject API so it is safe and regular!

[Python-Dev] Let's update CObject API so it is safe and regular! [Python-Dev] Let's update CObject API so it is safe and regular!Greg Ewing greg.ewing at canterbury.ac.nz
Thu Apr 2 13:28:34 CEST 2009
Jim Fulton wrote:

> The only type-safety mechanism for a CObject is it's identity.  If you  
> want to make sure you're using the foomodule api, make sure the  address 
> of the CObject is the same as the address of the api object  exported by 
> the module.

I don't follow that. If you already have the address of the
thing you want to use, you don't need a CObject.

> 2. Only code provided by the module provider should be accessing the  
> CObject exported by the module.

Not following that either. Without attaching some kind of
metadata to a CObject, I don't see how you can know whether
a CObject passed to you from Python code is one that you
created yourself, or by some other unrelated piece of
code.

Attaching some kind of type info to a CObject and having
an easy way of checking it makes sense to me. If the
existing CObject API can't be changed, maybe a new
enhanced one could be added.

-- 
Greg
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