PEP 8 and extraneous whitespace

Dan Sommers somm1105 at
Thu Jul 21 21:15:18 EDT 2011

On Thu, 21 Jul 2011 13:28:52 -0700, bruno.desthuilliers at 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

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 Sommers                                   A death spiral goes clock-
<>           wise north of the equator.
Atoms are not things. -- Werner Heisenberg              -- Dilbert's PHB

More information about the Python-list mailing list