At 01:26 PM 6/28/2007 -0400, Phillip J. Eby wrote: >You should also be able to delete unwanted function type attributes >like this:: > > from types import FunctionType > del dictionary_of(FunctionType)['func_closure'] > del dictionary_of(FunctionType)['func_code']
By the way, you probably want to also delete func_globals and func_defaults, as there are security ramifications to those attributes as well. Probably not so much for func_dict/__dict__ though. And of course, for Python<=2.4 you can just use the __call__ attribute and not bother with deleting anything but __subclasses__. _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com