On Apr 23, 2006, at 6:56 PM, Crutcher Dunnavant wrote:
>>
>
> They're blocks, what would be the use case for having the
> for/while/with/if stuff be treated different from class/def ? Besides,
> it comes up in platform handling code.
>
> if sys.platform == 'foo': class Bar:
>   ...
>
> class Foo:
>   if sys.platform == 'foo': def bar(self):
>     ...
>
>   else: def bar(self):
>     ...
>

That's (IMHO) gross to look at. Too much information on one line 
(especially your sys.platform example). The indent will be all off:

class Foo:
     if sys.platform == 'foo': def bar(self):
         do stuff


Having the method name physically further to the right than the method 
body just doesn't feel Pythonic. The nice thing about indenting is that 
everything likes up how you'd except it, quick glance and you know 
what's what.



Jay P.

_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to