Thoughts on language-level configuration support?

Aaron Brady castironpi at gmail.com
Wed Apr 1 19:40:51 CEST 2009


On Apr 1, 6:29 am, jfager <jfa... at gmail.com> wrote:
> On Apr 1, 3:29 am, Kay Schluehr <kay.schlu... at gmx.net> wrote:
>
> > > "Discoverable", as in built-in tools that let you have the following
> > > conversation:  "Program, tell me all the things I can configure about
> > > you" - "Okay, here they all are".  No digging through the source
> > > required.
>
> > But this doesn't have any particular meaning. If I run a dir(obj)
> > command all attributes of obj will be returned and I can be sure these
> > are all. In C# I can reflect on attributes of an assembly which is a
> > well defined entity. "Program" is not an entity. It's kind of a user
> > interface name in StarTreck ( which prefers "computer" for this
> > purpose though ). This way we cannot design systems.
>
> "Module and transitive graph of other modules (constructed through
> 'import' statements), tell me all the things I can configure about
> you".  Is that a little clearer?

Using shelve, which I suggested earlier, you have to rely on modules
to choose the options they want to make available.  You could require
them to store configs. on a per-module basis in separate files, or
require them to use separate namespaces in the shelf.

It could also be possible to interface with the target process's
garbage collector, but you're limited to objects you can identify in
the list of tracked objects, and only the ones that are mutable at
that.



More information about the Python-list mailing list