Message127595
Should we add imports in all examples? Eg. add import math in:
>>> repr(math.pi)
'3.141592653589793'
>>> str(math.pi)
'3.141592653589793'
At least, accumulate should be replaced by itertools.accumulate in the following example:
>>> list(accumulate(8, 2, 50))
[8, 10, 60]
Because it looks like accumulate() is a builtin function.
Some other examples without the module name: "tally = Counter(dogs=5, cat=3)", "d = OrderedDict...", "d = deque('simsalabim')", "all_polls_closed = Barrier(len(sites))", ...
I prefer to have the module name in examples because it is easy to test them: just copy/paste in an interpreter. It's even more easier if there is the import statement :-) |
|
Date |
User |
Action |
Args |
2011-01-31 13:05:04 | vstinner | set | recipients:
+ vstinner, georg.brandl, rhettinger, vinay.sajip, ncoghlan, eli.bendersky |
2011-01-31 13:05:04 | vstinner | set | messageid: <1296479104.03.0.866940900392.issue11071@psf.upfronthosting.co.za> |
2011-01-31 13:05:03 | vstinner | link | issue11071 messages |
2011-01-31 13:05:03 | vstinner | create | |
|