grok.py (module I found)

Peter Hansen peter at engcorp.com
Thu Aug 2 01:07:45 EDT 2001


Martijn Faassen wrote:
> 
> I've found this module somewhere linked from the Vaults of Parnassus,
> but then my browser crashed and I can't find the link anymore. Did it
> disappear from the vaults? The web page had a bunch of other interesting
> modules I wanted to check out. The URL had /psu at the end, I believe, but
> it's not in my browser history, probably due to the crash.. The code
> seems to be something for Python 3k.

> def grok(text):
>     # remember the time when we called this function
>     call_time = time.time()
> 
[...]
>     # otherwise, we want to time travel back to the moment in time
>     # just before (one second) we called the function, and try again
>     return timetravel.apply_at_time(grok, [text], {}, call_time - 1)

Ha!  More evidence that Python is one of the most optimizable 
languages ever.  Eventually we'll be able to use this construct
to execute many operations instantly, rather than just in 
parallel, resulting in O(n/n) behavior for all NP-complete
algorithms (and O(n/inf) for the incomplete ones).

And to think that this all began with the recent experiments
into Python-based quantum computing that the PSU h



More information about the Python-list mailing list