Meta programming question

Bruce Dickey brucedickey at micron.com
Mon Sep 29 13:17:55 EDT 2003


"Alex Martelli" <aleax at aleax.it> wrote in message
news:znzdb.132998$hE5.4530954 at news1.tin.it...
> Bruce Dickey wrote:
>
> > I've read a number of the meta progamming articles. I have not found
> > what I am looking for. I want to override assignments to variables which
> > are in the module namespace (not object members -- no classes involved).
> > Can this be done?
>
> No (not without, as somebody already suggested, rewriting substantial
> portions of Python's C-level implementation).  A module-level statement
>
>     <name> = <expression>
>
> evaluates the expression, and sets the name to refer to its value -- no
> ifs, no buts, no overriding, and nothing to do with metaprogramming.
>
>
> Alex
>

I think the path of least resistance is to preprocess a  (non-Python)
grammar language. My OP was a shot in the dark.

Thanks,

Bruce






More information about the Python-list mailing list