Why should I switch to Python?

Martijn Faassen m.faassen at vet.uu.nl
Wed Apr 12 13:04:08 EDT 2000


Blake Winton <bwinton at tor.dhs.org> wrote:
> On Fri, 31 Mar 2000 19:43:58 -0800, Aaron Turner wrote:
>>I've been coding Perl for over 3 years and really like it.  (Especially
>>it's syntax and ability to grok my programming style.)

> Now, just as a side note, why is it that the sets of The Perl Hackers I
> Know, and The People I Know Who Use The Word "Grok" are the same set?

It's in the hacker's dictionary:

http://www.tuxedo.org/~esr/jargon/html/entry/grok.html

And common in hacker slang (from the science fiction world).

Actually, Python 3000 will contain the 'grok' statement (I posted
about this long ago). It works like this:

grok:
   <arbitrary indented text>

So, you can do things like this:

grok:
    Hello, please give me a web page out of the
    financial reports of the third quarter 1999. It should be fast!

And your Python program will grok it and do it.

In fact, I lied: the indentation rules in the 'grok' statement can be broken
and Python 3k will grok that too:

if a == 1:
    grok:
 Hello this isn't really indented right
  but Python can figure it out
anyway...give me a 3d pacman game if I press the 'pacman' button
    a = a + 1 # continue suite with normal indentation
    
But the recommendation is not to do this as it will result in unreadable
code. Wrong indentation may not work in future versions of Python 3k 
either, as it's an implementation detail -- if you use it anyway expect
the effbot to snip at you. Then again, the timbot will release 
groknanny to fix this, so you are probably safe. It'll look like this:

(grokindent.py)
grok:
    Please fix the indentation of grok code in all
    files which have wrong indentation of grok code.
    now-this-is-easy-ly y'rs  - tim

As you see, it has all the usual timbot elegance and charm. :)

Yes-I've-been-using-the-time-machine-ly yours,

Martijn
-- 
History of the 20th Century: WW1, WW2, WW3?
No, WWW -- Could we be going in the right direction?



More information about the Python-list mailing list