[C++-sig] Re: accessing the python type system

Stefan Seefeld seefeld at sympatico.ca
Thu May 29 19:12:38 CEST 2003


David Abrahams wrote:

> I've been trying to say that I think the right answer is to provide a
> boost::python::object called 'type', something like:
> 
>    object const type = extract<object>(PyTypeObject*);
> 
> so you could do:
> 
>    object y = type(x);

oh, now I understand (at least partly). But this last line really
*creates* a type object given another object. So I don't understand
why 'type' has to be an object. Why not simply make it a function ?
Users' expectations would still be satisfied (the last line above
would still be valid), but no copy ctor is called.

Regards,
		Stefan





More information about the Cplusplus-sig mailing list