Christophe wrote: > That's easy, since A is a symbolic constant know at compile time, and > since it's a known mutable objet, the code once compiled will be > equivalent to: > > >>> b = [[]] > > >>> # much later > >>> b|0].append('1')
the OP talked about constants as names for immutable objects, not pre- processor macros. but alright, using the "symbolic constant" approach, what would this print ? >>> def foo(var): ... var.append('1') ... print var ... >>> b = [] >>> foo(b) >>> foo(b) and this ? >>> constant A = [] >>> print A is A </F> -- http://mail.python.org/mailman/listinfo/python-list