Message229123
Many of these (such as collections, collections.abc, decimal, and itertools) use import * as part of the doctest setup and are not part of the generated page shown to users.
Also, I don't think you should be aggressive about removing the other example that are visible users. The "import *" construct is part of the language and will be encountered occasionally.
For similar reasons, the decimal module was specifically designed for be easily usable with "import *" because of the numerous exceptions and rounding flags and constants.
There are also some examples such the one in cmd.rst that I put there on-purpose. Changing it would distract from the focus of the example.
With respect to Tkinter (and other gui toolkits as well), I believe that "import *" is a standard or common practice, in part because there are so many widget names names and widget options. Changing the example might make it more pep8-ish but would result in a good deal of clutter that isn't the normal practice.
> Should we finish the job? Or leave the issue to
> individual chapter authors?
I vote for leaving any changes to the chapter authors who are in a better position to know that they were trying to communicate or who were just setting up the doctests. As discussed above some of the import * are there for a reason.
We really need to start thinking of PEP 8 as something we do to our own code rather than something that gets inflicted on other people's code. |
|
Date |
User |
Action |
Args |
2014-10-12 07:19:47 | rhettinger | set | recipients:
+ rhettinger, georg.brandl, terry.reedy, mark.dickinson, docs@python, tshepang |
2014-10-12 07:19:47 | rhettinger | set | messageid: <1413098387.26.0.301328025264.issue22571@psf.upfronthosting.co.za> |
2014-10-12 07:19:47 | rhettinger | link | issue22571 messages |
2014-10-12 07:19:46 | rhettinger | create | |
|