On 11/07/20 10:35 am, Federico Salerno wrote:
I feel all those who aren't directly arguing against it are working off the assumption that it is needed for match and case to have different levels of indentation, but is this really true? Is there anything (bar tradition or other subjective arguments) that speaks in favour of this,
I can't think of one at the moment, but I don't think you should dismiss tradition so easily. One of the arguments used to justify significant indentation in Python is that "you're going to indent it for readability anyway, so the compiler might as well take notice of it". For the most part, Python indentation follows what people would naturally do even if they didn't have to. So I think it's worth looking at what people typically do in other languages that don't have mandatory indentation. Taking C, for example, switch statements are almost always written like this: switch (x) { case 1: ... case 2: ... default: ... } I've rarely if ever seen one written like this: switch (x) { case 1: ... case 2: ... default: ... } or like this: switch (x) { case 1: ... case 2: ... default: ... } This suggests to me that most people think of the cases as being subordinate to the switch, and the default being on the same level as the other cases. -- Greg _______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/MNDNVQTDNZDWVZ4NUTBBQQUG6K3WPKO4/ Code of Conduct: http://python.org/psf/codeofconduct/