[issue18472] PEP 8 updates - internal interfaces and import *

Nick Coghlan report at bugs.python.org
Tue Jul 16 14:14:30 CEST 2013


Nick Coghlan added the comment:

Attached diff has 5 changes:

* Explicit note that this is a living document that evolves over time
* Adds another explicit reason for not complying with the style guide (i.e. the code is old but still works and there's no other reason to change it)
* Fixed outdated info in the Tabs & Spaces section (Python 3 doesn't allow mixing them at all)
* Added an admonishment to avoid import *
* Added a new "Public and internal interfaces" section, that leans more heavily on documentation and __all__ than any of the proposals posted to python-dev

Some other oddities I noticed:

- given PEP 352, the admonishment to avoid string exceptions seems old and outdated. Can we just drop that?
- given PEP 3151, the suggestion to create a "domain specific base class" for the module also seems ill-advised. Perhaps we should remove that too?
- I've never understood the rationale for favouring absolute imports over explicit relative ones, so I had forgotten that suggestion was even in here. I've raised that one on python-dev, since I recall it being controversial, although I've never been able to fathom why. Explicit relative imports are just *better* in every way whenever they're applicable.

----------
keywords: +patch
Added file: http://bugs.python.org/file30936/issue18472_pep_8_update.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18472>
_______________________________________


More information about the Python-bugs-list mailing list