Can't override class |__new__

Lie Ryan lie.1296 at gmail.com
Thu Mar 5 08:25:37 EST 2009


jelle feringa wrote:
>>> CGAL.Facet = OtherFacet
>>> CGAL.Polyhedron.Facet = OtherFacet
>>> p = CGAL.Polyhedron_3()
> 
>> You're not creating Facet object here, not even Polyhedron.Facet.
> 
> Right, which is not the point; I'm trying to override the Facet, a topological
>  entity of which a Polyhedron is composed of .
> ( vertex -> halfedge -> facet -> polyhedron )
>  
>> I think so. External module written in C/C++ is often statically linked.
> 
> I'm sorry, but I don't follow you; what has linking to do with changing
>  the behaviour of the compiled module?

Aaron explained it better than I did. Basically the C/C++ module uses 
C/C++ version of Facet class directly without consulting python 
interpreter, this is what I meant by static linking.

Since python is dynamic language, all reference is dynamic, but C/C++ 
are static language, extensions written in C/C++ have to make extra 
effort to create dynamic reference.



More information about the Python-list mailing list