Re: [Python-ideas] Making colons optional?

On 6-Feb-09, at 8:41 PM, Mike Meyer wrote:
This is a very strange view of consistency to me. How many different kinds of list separators do we have? I can only think of semicolons and commas. I don't think semicolons are anything like commas. Non- trailing semicolons can be omitted, while non-trailing commas cannot, even if you put each item of [1,2,3] in separate lines. If you don't think consistency counts (at least in this case), I cannot argue with you---that's waaay off topic.

Riobard Zhan wrote:
In English: commas, semi-colons, slashes and newlines. There may be others, but I can't think of them off the top of my head. Examples: Sandwiches are made of bread, cheese, tomato, ham, and eggs. The hospital was visited by the following dignitaries: the President, Mr Obama; the Queen, Elisabeth II; and a famous actor, Bruce Willis. The invitation is for you and your wife/husband/partner. Shopping List: milk fruit meat In programming languages: commas and semi-colons are usual. OpenOffice spreadsheet uses ; to separate arguments to formulas, which never ceases to annoy me. I've seen at least one Context-Free Grammar format that uses vertical bar | as a list separator. I presume Lisp uses whitespace. If I recall correctly, so does Forth. Hypertalk separates "items" with commas and "words" with spaces, although the item delimiter was configurable in later versions. Tab delimited files use tabs as the item separator. In Python: only commas are item separators. Semi-colons and newlines are statement separators. Colons are not separators at all. -- Steven

On 8-Feb-09, at 4:35 AM, Steven D'Aprano wrote:
We are talking about Python here. Mike proposed it is consistent if we treat semicolons as separators in the same fashion as commas (another separators), which I do not think that is the right way (at least for me). See my other reply to Mike's reply if it is not clear. Nobody said colons are separators.

Riobard Zhan wrote:
In English: commas, semi-colons, slashes and newlines. There may be others, but I can't think of them off the top of my head. Examples: Sandwiches are made of bread, cheese, tomato, ham, and eggs. The hospital was visited by the following dignitaries: the President, Mr Obama; the Queen, Elisabeth II; and a famous actor, Bruce Willis. The invitation is for you and your wife/husband/partner. Shopping List: milk fruit meat In programming languages: commas and semi-colons are usual. OpenOffice spreadsheet uses ; to separate arguments to formulas, which never ceases to annoy me. I've seen at least one Context-Free Grammar format that uses vertical bar | as a list separator. I presume Lisp uses whitespace. If I recall correctly, so does Forth. Hypertalk separates "items" with commas and "words" with spaces, although the item delimiter was configurable in later versions. Tab delimited files use tabs as the item separator. In Python: only commas are item separators. Semi-colons and newlines are statement separators. Colons are not separators at all. -- Steven

On 8-Feb-09, at 4:35 AM, Steven D'Aprano wrote:
We are talking about Python here. Mike proposed it is consistent if we treat semicolons as separators in the same fashion as commas (another separators), which I do not think that is the right way (at least for me). See my other reply to Mike's reply if it is not clear. Nobody said colons are separators.
participants (2)
-
Riobard Zhan
-
Steven D'Aprano