New to Python - block grouping (spaces)yhoni
bc at freeuk.com
Thu Apr 16 15:44:15 CEST 2015
On 16/04/2015 14:18, alister wrote:
> On Thu, 16 Apr 2015 13:07:22 +0200, Antoon Pardon wrote:
>> Nobody is argueing for arbitrary indentation.
> May I suggest that you give it a try for a month, perhaps re-writing a
> small program you already have in a pythonic style (don't simply write c
> in python) & see if your opinion changes.
You mean try writing pure Python for a month? Yes, you can get used to
anything. But that doesn't take away from the issues that some people
have with its indentation. In my case, that would be the following
(apart from the extra fragility of the code which you can't argue with):
* I need some closure, some indication of where the end of a block is.
Otherwise how do I know I'm looking at the last statement, or whether
there is more on the next page or further down the screen?
Even when I can see what follows the block, I can only infer that this
is the end of the block because I eventually hit some other arbitrary
construct with less indentation, not something specifically signalling
the end of /that/ block.
(This would come up when using copy&paste for example. If I've
accidentally left out the last line of a block, I won't know about it
until the code later doesn't work.)
* I modify code a lot, adding and removing extra nested blocks all the
time. My editor can't indent or un-indent blocks without a lot of manual
typing. With block-delimited schemes, this isn't an issue, as temporary
lack of correct indentation isn't crucial.
(However, given a choice of only brace-delimited blocks, and Python
style, I'd go for the latter! I have a longer list of complaints for
More information about the Python-list