On 15Aug2015 18:24, D Wyatt <fiberfo...@gmail.com> wrote:
It seems every book I read these days uses camel case for variable names in
Python.  I was once told that using underscores is preferred.  Is there a
preference in the Python community or does it really matter?  I'd like to
instill good habits while I'm learning.

PEP 8 is lowercase with underscores for normal variables. Class names tend to be CamelCase. I try to follow this. One advantage in staying with this is that you share this convention with the stdlib and with a lot of other Python code, which make it easier for you to read because it aligns with your own habits. Ideally, anyway.

If you're not invested in another style, and not working in someone else's codebase with its own conventions, try PEP 8.

Cheers,
Cameron Simpson <c...@zip.com.au>

Oh, what tangled webs we weave,
   when first we practice to deceive.
   And when we've practiced for awhile,
   How we do improve our style!        - Dorothy Parker
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to