From: John H. <jdh...@ac...> - 2007-01-10 17:56:42
|
>>>>> "Steve" == Steve Chaplin <ste...@ya...> writes: Steve> Matplotlib does use a lot of relative imports which I think Steve> is bad style. Steve> See PEP 8 "Style Guide for Python Code" Steve> http://www.python.org/dev/peps/pep-0008/ Steve> - Relative imports for intra-package imports are highly Steve> discouraged. Always use the absolute package path for all Steve> imports. Even now that PEP 328 [7] is fully implemented in Steve> Python 2.5, its style of explicit relative imports is Steve> actively discouraged; absolute imports are more portable Steve> and usually more readable. I have never run into a problem with relative imports, though I don't object to removing them. Why are they bad style and what is the danger? Steve> There was a recent "Coding Guide" thread on this list Steve> (which I admit I just skimmed through). Instead of Steve> reinventing the wheel, how about stating at the top of Steve> CODING_GUIDE that PEP 8 is the default style for Steve> matplotlib, and the following notes give in-depth Steve> matplotlib examples (or possibly override PEP 8 if Steve> necessary). Agreed -- I'll update the coding style section to refer to this document, and provide a few comments in line. JDH |