Meta programming question

Bruce Dickey brucedickey at
Mon Sep 29 19:17:55 CEST 2003

"Alex Martelli" <aleax at> wrote in message
news:znzdb.132998$hE5.4530954 at
> 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.



More information about the Python-list mailing list