> FOO = 1 > > def f(x=FOO): > ... > > > Use this instead: > > def f(x=1): > ...
I tend to use constants as a means of avoiding the proliferation of magic literals for maintenance reasons... Like say if your example of FOO would have been used in 10 places. Maybe it is more pythonic to simply denote such a thing as simply a normal variable? That doesn't seem to give a hint that it shouldn't be assigned a second time. -- http://mail.python.org/mailman/listinfo/python-list