Embedding Python and built-in types
Martin v. Löwis
martin at v.loewis.de
Fri Nov 29 18:12:29 EST 2002
"Mickael Putters" <pylist at dreamingprophet.com> writes:
> Well, I was talking about the assignment operator, maybe it's not =.
> Yeah well guess I'll have to modify the source, I thought maybe there would
> be a way to do that already present in Python/C.
Ah, that's not an operator: assignment is not an expression; it is a
statement (but it is =).
Controlling assignment is even more difficult. Assignments usually
results in a dictionary operation. Intercepting all kinds of
assignment won't be easy. If you are just looking for assignments to
global variables, you might intercept the dictionary write operation.
Using non-dictionary objects to keep global variables (so that you can
intercept writes and reads) is a long-standing wish; it hasn't been
granted because there is no efficient implementation for it that
doesn't cause significant penalties if there is no interception.
Regards,
Martin
More information about the Python-list
mailing list