Guido van Rossum <[EMAIL PROTECTED]> writes: > On 1/10/06, Delaney, Timothy (Tim) <[EMAIL PROTECTED]> wrote: >> Guido van Rossum wrote: >> >> > On 1/10/06, Thomas Heller <[EMAIL PROTECTED]> wrote: >> >> I would like to suggest to include ctypes into core Python, starting >> >> with the 2.5 release. >> > >> > On the one hand I agree that this is a useful module, popular, mature >> > etc. >> > >> > On the other hand it breaks one of the most fundamental Python >> > guidelines: if you get a core dump (segfault etc.) it's a bug in >> > Python or in a 3rd party extension, not in *your* Python code. An >> > exception would have to be made for any code that uses ctypes, as it >> > is usually trivial to cause core dumps with ctypes (I'd venture it's >> > hard to avoid them ;-). >> > >> > I don't expect this to count against including ctypes; but I do want >> > it to be dealt with somehow! >> >> As was pointed out on c.l.py, the `dl` module suffers the exact same >> problem (I don't know myself, as I've never used it). There are no >> warnings about this in the `dl` module documentation. > > Good point. I think there should be such warnings though. > >> I can't see how it would be possible to guarantee that such a module >> could not cause crashes. > > And I'm not asking for that. > >> I'm of the opinion that having a big red >> warning at the top of the module documentation that this is a >> contributed module, and incorrect use could cause segmentation >> faults/crashes, etc would be sufficient. > > Works for me.
Another possibility would be to emit a warning when the module (dl or ctypes, if included) is imported. warnings.warn("Incorrect usage of this module may crash Python", RuntimeWarning, stacklevel=2) Thomas _______________________________________________ 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