trouble with the C API

Stefan Seefeld seefelds at magellan.umontreal.ca
Mon Aug 21 15:21:02 EDT 2000


Bernhard Herzog wrote:

> The PyDict functions only work with dictionary objects. The PyMapping
> funtions are more general and work with all objects that support the
> mapping protocol at the C-level.

uhm, it appears I don't understand the python object model.
How is the type of an object determined if not by inspection of the
supported protocols (i.e. the existence of certain attributes, methods etc.) ?

Well, looking at the (C) sources I get part of the answer: Each object
has a type object associated with it. Let's rephrase the question then:

doesn't each object have two types, one static type, determined by the
type object it refers to and one dynamic type, given through the presence
(at a given point in time !) of a particular method or attribute ?

Why this ambiguity ?

(please excuse my lack of understanding. I'm deeply trained by the C++
 object model so I may have difficulties to adopt to other forms of life ;)

Regards,	Stefan
_______________________________________________________              
              
Stefan Seefeld
Departement de Physique
Universite de Montreal
email: seefelds at magellan.umontreal.ca

_______________________________________________________

      ...ich hab' noch einen Koffer in Berlin...



More information about the Python-list mailing list