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 rhettinger
Recipients docs@python, georg.brandl, mark.dickinson, rhettinger, terry.reedy, tshepang
Date 2014-10-12.07:19:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1413098387.26.0.301328025264.issue22571@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2014-10-12 07:19:47rhettingersetrecipients: + rhettinger, georg.brandl, terry.reedy, mark.dickinson, docs@python, tshepang
2014-10-12 07:19:47rhettingersetmessageid: <1413098387.26.0.301328025264.issue22571@psf.upfronthosting.co.za>
2014-10-12 07:19:47rhettingerlinkissue22571 messages
2014-10-12 07:19:46rhettingercreate