embedding python in C++

Alex Martelli aleaxit at yahoo.com
Wed Jan 10 06:17:36 EST 2001


"Syver Enstad" <syver at NOSPAMcyberwatcher.com> wrote in message
news:93g8sp$pcj$1 at troll.powertech.no...
>
> "Alex Martelli" <aleaxit at yahoo.com> wrote informatively as usual in
> news:93fgim04oc at news1.newsguy.com...
>
> > I don't know what happens if you don't let softspace be set & read
> > (i.e., whether print degrades gracefully or what)
> It seems to degrade gracefully in my experience, which is rather small.

Mine, zero (only time I needed a C-coded Python object to be
set as sys.stdout, I _did_ embue it with a softspace attribute!-).


> >-- note that all
> > Python instance objects ARE 'expando' (Javascript terminology) by
> > defaults, so you don't normally have to do anything special to enable
> > it, but, if you're using your own C-level type rather than a Python
> > implemented instance...
>
> Of course, thats why you don't have to have a softspace member in a py
> object. The caller just tags it onto the object when he needs to.

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.


Alex






More information about the Python-list mailing list