Alternate indent proposal for python 3000

bruno.desthuilliers at gmail.com bruno.desthuilliers at gmail.com
Sun Apr 20 20:54:56 CEST 2008


On 20 avr, 17:35, Eric Wertman <ewert... at gmail.com> wrote:
> I was considering putting together a proposal for an alternate block
> syntax for python, and I figured I'd post it here and see what the
> general reactions are.  I did some searching, and while I found a lot
> of tab vs space debates, I didn't see anything like what I'm thinking
> of, so forgive me if this is a very dead horse.
>
> Generally speaking, I like the current block scheme just fine.  I use
> python on a daily basis for system administration and text parsing
> tasks, and it works great for me.
>
> From time to time, though, I find myself needing a language for server-
> side includes in web pages.  Because of the need to indent (and
> terminate indents), python seems an awkward choice for this, and it's
> easy for me to see why php and perl are more popular choices for this
> kind of task.  Perhaps this is just my perception though.

The server-page scheme has long shown it's limitations and quirks -
mostly, you end up mixing application logic and presentation logic.
Even PHP programmers are slowly taking the MVC route.

> 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?

Python Server Page packages are nothing new, and didn't help making
Python more popular for web developpement. MVC frameworks like Django,
Pylons, Turbogears or web.py seems to draw way more attention, and we
start to see PHP coders switching to Django - which is the one with
the IMHO weakest templating language.

If you're looking for a templating system with Python syntax support,
you may want to take a look at Cheetah and (my favourite one) Mako.
Mako is the default template system for Pylons, and IIRC web.py
supports Cheetah (warning: never used web.py, and haven't followed
recent dev, so you'd better check by yourself).

HTH



More information about the Python-list mailing list