naming convention for scalars, lists, dictionaries ...

Just just at xs4all.nl
Mon Feb 28 15:41:37 EST 2005


In article <mailman.3152.1109622405.22381.python-list at python.org>,
 Jack Diederich <jack at performancedrivers.com> wrote:

> On Mon, Feb 28, 2005 at 04:02:37PM -0500, Benji York wrote:
> > Jack Diederich wrote:
> > >Ditto for me, plural implies list and singular implies instance, 
> > >for (contact) in contacts:
> > >   # do something with contact
> > 
> > May I ask why you place the parenthesis in the for statement?
> 
> I like the tuple-ness feel of it and frequently unpack multiple
> values in for loops.  I also like the visual feel, it makes it
> easy to see what is being unpacked and what is the source.
> 
> "for (one, two, three) in somelist:"
> versus
> "for one, two, three in sometlist:"
> 
> Even with a colorizing editor (emacs) I find the first version
> easier to read.  YMMV.

But you're using it for _single_ values. That's like writing

      (val) = someFunction(...)

Just



More information about the Python-list mailing list