This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients eli.bendersky, georg.brandl, ncoghlan, rhettinger, vinay.sajip, vstinner
Date 2011-01-31.13:05:03
SpamBayes Score 4.7618474e-08
Marked as misclassified No
Message-id <1296479104.03.0.866940900392.issue11071@psf.upfronthosting.co.za>
In-reply-to
Content
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 :-)
History
Date User Action Args
2011-01-31 13:05:04vstinnersetrecipients: + vstinner, georg.brandl, rhettinger, vinay.sajip, ncoghlan, eli.bendersky
2011-01-31 13:05:04vstinnersetmessageid: <1296479104.03.0.866940900392.issue11071@psf.upfronthosting.co.za>
2011-01-31 13:05:03vstinnerlinkissue11071 messages
2011-01-31 13:05:03vstinnercreate