IsPython really O-O?

Tim Hammerquist tim at vegeta.ath.cx
Tue Nov 13 18:04:45 EST 2001


Matt Gerrans <mgerrans at ix.netcom.com> graced us by uttering:
> Tim Hammerquist <tim at vegeta.ath.cx> wrote
> 
>> If you really need to raise a discussion, the posters
>> comp.lang.smalltalk...
> 
> Okay, I'm off to the smalltalk group to declare that "Python is more OO than
> Smalltalk!"   Who will ensure that I get a decent burial?

They may be too deeply involved debating RDBMS vs OODBMS to even see
your post.  ;)

>> $ cat debate
>> #!/usr/local/bin/python
>>
>> assert time is infinite
>> steve = Zealot(SmallTalk)
>> matt  = Advocate(Python)
>>
>> while isinstance(steve, Zealot):
>>     try:
>>         matt.argue()
>>         if isconvinced(steve):
>>             break
>>         pigs.fly()
>>         steve.say("I'm not convinced.")
>>     except:
>>         steve.say("Hah! You can't prove it!")
>>
>> $ chmod 700 debate
>> $ debate and echo "They all lived happily ever after."

This last should have been:

$ debate && echo "They all lived happily ever after."

Thus, && tests the exit value of debate, debate can never return true,
(since at no point is steve .convinced), and no one ever lives happily
ever after.  Cynical yet apropos.

> Cute, I like it!   (although I don't claim to be a Python Advocate -- I
> advocate using the best tool for the job, which means the more tools you know
> how to use, the better your odds are).

Touché.  This means I won't be garroted for mentioning Perl elsewhere in
this thread?  ;)

Tim Hammerquist
-- 
No violence, gentlemen -- no violence, I beg of you!  Consider the furniture!
    -- Sherlock Holmes



More information about the Python-list mailing list