Dan Sommers wrote: > bruno.desthuilli...@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?
I do not know what you *think* we all know, and I do not quite see your point. I for one have pondered this question and have found the suggestion in the PEP a reasonable one, for if you use a function call in the RHS of an assignment the lack of whitespace around the equals sign for the keyword argument makes it easier to see the final assignment: d = dict(key=val) vs. d = dict(key = val) vs. d = key = val YMMV. -- PointedEars Bitte keine Kopien per E-Mail. / Please do not Cc: me. -- http://mail.python.org/mailman/listinfo/python-list