Alternate indent proposal for python 3000

Matthew Woodcraft mattheww at chiark.greenend.org.uk
Sun Apr 20 12:42:05 EDT 2008


Christian Heimes  <lists at cheimes.de> wrote:
>> I feel that including some optional means to block code would be a big
>> step in getting wider adoption of the language in web development and
>> in general.  I do understand though, that the current strict indenting
>> is part of the core of the language, so... thoughts?

> Why should Python repeat the mistakes other languages did with SSI or
> <?php ?> inline code? Python favors the MVC separation of code and layout.

An alternative scheme for describing the block structure could be
useful in other cases, though. For example, if you wanted to support
putting snippets of Python in configuration files, or spreadsheet
cells.

There's no need to support the new scheme in .py files, so it seems to
me that this doesn't have to be done in the core language. All that's
needed is a variant of 'eval' which expects the alternate scheme, and
that could be prototyped just using text manipulation and the normal
'eval'.

If someone wrote a library for this and it proved popular, I expect it
would be considered for the standard library.

-M-



More information about the Python-list mailing list