PEP 498: """ Leading whitespace in expressions is skipped <https://www.python.org/dev/peps/pep-0498/#id28> Because expressions may begin with a left brace ('{'), there is a problem when parsing such expressions. For example: >>> f'{{k:v for k, v in [(1, 2), (3, 4)]}}' '{k:v for k, v in [(1, 2), (3, 4)]}' """ For me, this example is crazy. You should not add a special case (ignore spaces) just to support a corner case. This example can easily be rewritten using a temporary variable and it makes the code simpler. items={k:v for k, v in [(1, 2), (3, 4)]; f'{items}' Seriously, a dict-comprehension inside a f-string should be considered as an abuse of the feature. Don't you think so? Victor -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20150811/c1305b6e/attachment.html>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4