@@ -867,6 +867,32 @@ there is little need of new syntax and a confusion of statement vs
867
867
expression to achieve this.
868
868
869
869
870
+
Common objections
871
+
=================
872
+
873
+
Colons always introduce suites
874
+
------------------------------
875
+
876
+
While it is true that many of Python's syntactic elements use the colon to
877
+
introduce a statement suite (if, while, with, for, etcetera), this is not
878
+
by any means the sole use of the colon. Currently, Python syntax includes
879
+
four cases where a colon introduces a subexpression:
880
+
881
+
* dict display - { ... key:value ... }
882
+
* slice notation - [start:stop:step]
883
+
* function definition - parameter : annotation
884
+
* lambda - arg list: return value
885
+
886
+
This proposal simply adds a fifth:
887
+
888
+
* except-expression - exception list: result
889
+
890
+
Style guides and PEP 8 should recommend not having the colon at the end of
891
+
a wrapped line, which could potentially look like the introduction of a
892
+
suite, but instead advocate wrapping before the exception list, keeping the
893
+
colon clearly between two expressions.
894
+
895
+
870
896
Copyright
871
897
=========
872
898
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