Just because somebody asked, I had to show that it can be done. But no, doc strings are not the place to store static data.
1 #! /usr/bin/env python
2
3 # Foo! Don’t do this.
4 # Author: Lorenzo E. Danielsson <danielsson +dot+ lorenzo [at] gmail *dot* com>
5
6 def bleech():
7 "0"
8 bleech.__doc__ = str(int(bleech.__doc__) + 1)
9 print "I have been called %s time%s." % (
10 bleech.__doc__,
11 bleech.__doc__ != ‘1‘ and ’s‘ or ”)
12
13 for i in range(10):
14 bleech()


