changing a value of a variable

Jason Orendorff jason at jorendorff.com
Wed Jan 30 10:08:51 EST 2002


Karl M. Syring wrote:
> "Aahz Maruch" schrieb
> > Marcin Matuszkiewicz wrote:
> > >How to write a python program that accomplishes the same thing as the
> > >C program below. [...]
> >
> > Did you try compiling and running this C program?
> 
> Works as advertised:
> gcc -o crash crash.c
> crash.c: In function `main':
> crash.c:11: warning: passing arg 1 of `assign' makes pointer from integer
> withou
> t a cast
> crash
> crash.exe caused an Access Violation at location 00401212 in module
> crash.exe Writing to location 00000000.

Oh, so *that* was the question.  Well, Python is designed to
be relatively crash-safe, but if you grab some of the extension
libraries like win32all or SDL, you should be able to trigger
a crash if you work hard enough at it.

On the other hand, if the user intended assign(&n), then the
corresponding Python program is an empty file (the program
in fact "accomplishes" nothing).

## Jason Orendorff    http://www.jorendorff.com/




More information about the Python-list mailing list