Possible constant assignment operators ":=" and "::=" for Python
Fredrik Lundh
fredrik at pythonware.com
Fri May 5 05:12:14 EDT 2006
Christophe wrote:
> I think you've made a mistake in your example.
>>> constant A = []
>>> def foo(var):
... var.append('1')
... print var
...
>>> b = A
>>> foo(b)
>>> foo(b)
> > and this ?
> >
> > >>> constant A = []
> > >>> print A is A
>
> Obviously, False.
why obviously ? why shouldn't a constant be constant ?
</F>
More information about the Python-list
mailing list