[Bf-taskforce25] Proposal to follow PEP8 for all python scripting for Blender 2.5

Campbell Barton ideasman42 at gmail.com
Fri May 29 04:08:43 CEST 2009


Tentative +1, In quite happy to keep on using tabs however following
the py standard seems reasonable.
Of course we need to update blenders text editor to use spaces instead
of tabs by default.

One thing I dont agree with is the 80 char line width rule, sometimes
I just want to keep a big clunky loop without having to break it up
into function calls.
Example from FBX Exporter
http://www.pasteall.org/5794/python

If I was forced to follow the 80 char rule Id end up using shorter
(harder to comprehend) names,
and break something I already have trouble understanding (undocumented
FBX spec), into small functions that mean more searching around to fix
a problem.
Splitting it across lines is OK in some cases but can break
readability in others.
So for the moment Id like to ignore the 80 char limit, or at least
follow for most scripts but allow exceptions.

- Campbell

On Thu, May 28, 2009 at 6:29 AM, Stani <spe.stani.be at gmail.com> wrote:
> I think Blender 2.5 is a good occasion to adopt the PEP8 Style Guide
> for Python Code, which is widely spread in the Python community. This
> will enhance the chance to make code more readable, make it more easy
> to share code and to collaborate. The PEP8 is the result of many years
> of very experienced Python coders (Guido et alii.) and I can garantuee
> it is hard to compete with them ;-)
>
> This intention was already formulated in "Style and PEP-8" on
> http://wiki.blender.org/index.php/BlenderDev/Blender2.5/PythonAPI
>
> What I like to do is, make it official and even to encourage it for
> anyone writing scripts in Blender. One of the important details of the
> PEP8 is: "For new projects, spaces-only are strongly recommended over
> tabs." (I think now both spaces and tabs are used, which will create
> confusion in the end.) It might seem some trouble now to adopt to
> this, but it will save much more trouble later.
>
> Can we vote on this issue and depending on the outcome make the switch?
>
> Stani
>
> --
> Phatch Photo Batch Processor - http://photobatch.stani.be
> SPE Python IDE - http://pythonide.stani.be
> _______________________________________________
> Bf-taskforce25 mailing list
> Bf-taskforce25 at blender.org
> http://lists.blender.org/mailman/listinfo/bf-taskforce25
>



-- 
- Campbell


More information about the Bf-taskforce25 mailing list