Desactivating Python keywords and built-in functions

Larry Bates lbates at syscononline.com
Fri Oct 8 13:00:03 EDT 2004


Peter L Hansen wrote:
> Benjamin Niemann wrote:
> 
>> Various people have tried this but failed...
>> Python's dynamic nature is too powerful and sufficiently intelligent 
>> hackers will always find a way around your restrictions.
> 
> 
> Maybe not *always*, but certainly nobody has yet shown themselves
> willing and able to go all the way with an implementation which
> is sufficiently secure that they could prove you wrong. ;-)
> 
> -Peter

Couldn't you rebind the functions that you want to deactivate
to another function that didn't do what you don't want done?

def eval(s, g=None, l=None):
     pass

Seems like those new to Python do this all the time with
list, dict, etc.

-Larry



More information about the Python-list mailing list