safer ctype? (was GUIs - A modest Proposal)

Bryan bryanjugglercryptographer at yahoo.com
Sat Jun 12 04:52:38 EDT 2010


Martin P. Hellwig wrote:
> Martin v. Loewis wrote:
> <cut>> The issue is not that you may mistakes in the ctypes code, thus allowing
> > users to crash Python. The issue is that if users remove ctypes (which
> > they may want to do because it's not trustworthy), then your module will
> > stop working (unless you have a fallback for the case that ctypes is
> > unavailable).
>
> <cut>
> Got me thinking, is it perhaps doable to have a 'safe' ctype that is
> guaranteed to be in the stdlib? Perhaps crippling it in a sense that it
> only allows a known set of functions to be called?
> My gut feeling is that you open a can of worms here but I would
> appreciate your opinion.

Perhaps instead of restricting what functions ctypes can use, we could
restrict what modules can use ctypes. For example, maybe only modules
in certain directories should be allowed to import ctypes.


--
--Bryan Olson




More information about the Python-list mailing list