Dr. Dobb's Python-URL! - weekly Python news and links (Mar 26)

phil hunt philh at comuno.freeserve.co.uk
Wed Mar 27 08:21:53 EST 2002


On Tue, 26 Mar 2002 20:23:44 +0000, Dale Strickland-Clark <dale at riverhall.NOTHANKS.co.uk> wrote:
>"Dean Goodmanson" <ponderor at lycos.com> wrote:
>
>>"The joy of coding Python should be in seeing short, concise, readable
>>classes that express a lot of action in a small amount of clear code -- not
>>in reams of trivial code that bores the reader to death."  Guido van Rossum
>>
>
>I didn't see the original post but I *really* hope this was said in
>jest.

I would very much hope not.

And Guido's statement supports my suggestion that pass be made 
optional in Python. Consider, when someone is designing a class, 
one could write an outline like this:

class BaseClass:

class MyClass(BaseClass):
   def __init__(self):
   def method1(self, a, b, c):
   def method2(self, d, e):
   def method3(self, f):

It is perfectly clear what this means. But unfortunately, as Python
stands today, it is syntactically invalid, one would have to say:

class BaseClass:
   pass
 
class MyClass(BaseClass):
   def __init__(self):
      pass
   def method1(self, a, b, c):
      pass
   def method2(self, d, e):
      pass
   def method3(self, f): 
      pass

And then, when you begin to flesh out your code, you would have to 
get rid of the extraneous passes you didn't want to add (assuming 
you are like me) in the first place. So the with-pass version 
requires more effort, and is more verbose, for no good reason.


-- 
<"><"><"> Philip Hunt <philh at comuno.freeserve.co.uk> <"><"><">
"I would guess that he really believes whatever is politically 
advantageous for him to believe." 
                        -- Alison Brooks, referring to Michael
                              Portillo, on soc.history.what-if



More information about the Python-list mailing list