[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Scripting language



Richard Tew wrote:
while True:
  pass

def fib(n):
  return fib(n-1) + fib(n-2)
fib(1000000)

If you were using Stackless Python, this sort of thing could easily be detected, interrupted and discarded.

But what about things like

   x = 100000000000000000000000 ** 1000000000000000000000000

I wonder if this recipe were taken to the safe extreme, how
much of a subset of Python could be safely allowed:

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/286134

Probably not feasible to relax it enough to allow non-trivial code without opening up unwanted abilities.

--
Greg