PEP 8 and extraneous whitespace

Dan Sommers somm1105 at bellsouth.net
Fri Jul 22 03:15:18 CEST 2011


On Thu, 21 Jul 2011 13:28:52 -0700, bruno.desthuilliers at gmail.com wrote:

> 1/ you can consider the equal sign ('=') is the "binding operator".
> 
> 2/ since {'key':'val'} is equivalent to dict(key=val), you can consider
> colons as a binding operator here

But PEP 8 (under Other Recommendations) indicates spaces around the 
former but not the latter:

    key = val
    dict(key=val)

We all know that there should be one-- and preferably only one --obvious 
way to do it.  But what do we also know about foolish consistency?

Dan

-- 
Dan Sommers                                   A death spiral goes clock-
<http://www.tombstonezero.net/dan/>           wise north of the equator.
Atoms are not things. -- Werner Heisenberg              -- Dilbert's PHB



More information about the Python-list mailing list