[C++-sig] Re: Boost.Python unnamed enums at global scope

Nicodemus nicodemus at globalite.com.br
Sun Aug 3 03:47:33 CEST 2003


----- Original Message -----
From: "Niall Douglas" <s_sourceforge at nedprod.com>
To: "pysig" <c++-sig at python.org>
Sent: Saturday, August 02, 2003 8:31 PM
Subject: [C++-sig] Re: Boost.Python unnamed enums at global scope


> Nicodemus wrote:
>
> > Nice, I didn't know that either. I think this mirrors the enum
> > behaviour of C++ better. How should Pyste support this? I believe it
> > is more interesting if Pyste always called export_values(), but this
> > would break backwards compability. Thoughts?
>
> Command line switch. I'm pretty sure with time everyone will switch.

Agreed.

> > Niall, another solution would be to explicitly export the names to the
> > global namespace in the Python side (untested):
> >
> >     # my_module.py
> >     import _my_module  # this is the extension module
> >
> >     for name, value in _my_module.unnamed.__dict__:
> >         globals()[name] = value
>
> It's alright - it's easier to customise pyste to make it do what I
> prefer now Dave has said how.

Indeed, it is easy enough to do so, just some hacking in EnumExporter.py. 8)

> BTW, did you receive my extensive list of bugs & ideas I sent to your
> email address? I even supplied fixes! :)

Sorry, I think didn't get any email from you (I don't remember, and
unfortunately I'm not at my computer right now to confirm 8( )... Anyway,
could you send them again, please? Thanks a lot! 8)

Regards,
Nicodemus.





More information about the Cplusplus-sig mailing list