<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
<pre>Ah, that's pretty disappointing - I was hoping that Python would be 'tighter' than that. Although I appreciate the feedback - thank you.<br><br>As a follow up:<br><br>Since Python (at this time) cannot be cleanly re-initialized, would it be valid / sane to just create and destroy new sub-interpreters as needed?<br><br>So, instead of calling Py_Finalize() and Py_Initialize() to re-init Python, is it acceptable to use Py_NewInterpreter() and Py_EndInterpreter() <br>to achieve a similar effect? Barring the obvious bugs/caveats in the documentation, is there anything especially bad or wasteful about this?<br><br>I am also curious (and would appreciate a response) - how do the guys at CCP manage this type of situation? Or is it not a problem?<br><br>Thanks!<br><br>Mark Gants <br><br>---------- Forwarded message ----------<br>From: OvermindDL1 &lt;overminddl1@gmail.com&gt;<br>Date: Sat, Feb 14, 2009 at 6:10 PM<br>Subject: Re: [Stackless] Cannot re-initialize Python<br>To: Richard Tew &lt;richard.m.tew@gmail.com&gt;<br> <br>On Sat, Feb 14, 2009 at 8:17 AM, Richard Tew &lt;richard.m.tew@gmail.com&gt; wrote:<br>&gt; On Sat, Feb 14, 2009 at 9:03 AM, Mark Gants &lt;mgants4@hotmail.com&gt; wrote:<br>&gt;&gt; I have embedded Stackless Python 2.6.1 into a C++ application of mine. At<br>&gt;&gt; certain points in the application I would like to 're-init' Python to clean<br>&gt;&gt; things up without having to shutdown and re-launch my application. First<br>&gt;&gt; time initializing Python works fine. I encounter a crash though when trying<br>&gt;&gt; to initialize Python a second time.<br>&gt; ...<br>&gt;&gt; Does anyone know if this issue has been addressed in Stackless Python 3.0? I<br>&gt;&gt; would like to use v3.0, but chose v2.6.1 due to the warnings about bugs in<br>&gt;&gt; v3.0.<br>&gt;<br>&gt; There is no reason to believe it would be fixed in 3.0, as no explicit<br>&gt; fixes have been made for this.<br> <br>I ran into this myself long ago as well.  As such I came up with the<br>fact that Python was not designed, nor will ever be designed to be<br>cleanly shutdown, it just will not clean up well, it expects the<br>program to shut down as soon as it shuts down, so the program shutdown<br>will clean the rest up.  As such, it will never re-init well as well,<br>not without some major patching anyway.<br>It has nothing to do with Stackless though, this is a pure Python annoyance.</pre></body>
</html>