embedding python in C++

Alex Martelli aleaxit at yahoo.com
Wed Jan 10 12:09:39 EST 2001


"Syver Enstad" <syver at NOSPAMcyberwatcher.com> wrote in message
news:mMZ66.1325$k25.19052 at news1.oke.nextra.no...
>
> "Alex Martelli" <aleaxit at yahoo.com> wrote in message
> news:93hgeq014d3 at news2.newsguy.com...
> > Just reiterating an important point: this is true for *instances*,
> > where such after-the-fact tagging is implemented; it may not be for
> > a typical C-coded type, unless care is taken to let the caller set
> > (and re-read) arbitrary attributes.
>
> This is done by implementing setattr so that it assigns values to python
> dictionary that is a member of the C type, right?

Yes, and getattr accordingly; or you can just watch for the 'softspace'
name and keep one bit to record that, if all you need is fileobject
emulation for print-statement purposes.


Alex






More information about the Python-list mailing list