Yet another comparison of Python Web Frameworks

Kay Schluehr kay.schluehr at gmx.net
Wed Oct 10 21:24:29 CEST 2007


On Oct 10, 8:15 pm, Peter Otten <__pete... at web.de> wrote:
> Kay Schluehr wrote:
> >>http://mdp.cti.depaul.edu/examples
>
> > The delivered sourcecode is syntactically broken. Tabs and whitespaces
> > were mixed and when I open a file like gluon/global.py I find sections
> > like this:
>
> > class Request(Storage):
> >     """
> >     defines the request object and the default values of its members
> >     """
> >     def __init__(self):
> >     self.env=Storage()       # this line is incorrect syntax in Python
>
> You may have configured your editor to use a tabwidth of four spaces
> (Python always uses 8).
>
> Peter

You are right! I looked at the tokenizer.py module and the default
value for tabsize is 8. Now I feel stupid since I believe everyone
knew this for at least a decade and it is somewhere between page 1 and
10 of the Python tutorial I didn't look at for 5 years or so.

Now I get the following class definition:

class Request(Storage):
    def __init__(self):
	self.env=Storage()
	self.cookies=Storage()
	self.get_vars=Storage()
	self.post_vars=Storage()
	self.vars=Storage()
	self.application=None
	self.function=None
	self.args=[]
    pass

This is syntactically correct but the "pass" at the end makes me worry
about understanding even less about yet unknown language conventions
( setting pass as an endmarker of a block ) or the programmers
intentions or both. It's very scary in either way and I might need a
few days of recovering.

Kay




More information about the Python-list mailing list