[Cython] failure of withstat
Lisandro Dalcin
dalcinl at gmail.com
Tue Feb 10 15:41:21 CET 2009
On Tue, Feb 10, 2009 at 12:22 PM, Dag Sverre Seljebotn
<dagss at student.matnat.uio.no> wrote:
>>
> Ah. Yes, I noticed, but after commenting on the ticket. So apparently it
> is NOT a C++-only issue, but something much more strange going on ...
>
Indeed. It seems Cython 'memoizes' counters for a module context, then
if you compile twice, the counters are not reinitialized. Or somethig
like that....
You know, module or class level globals could be rally evil :-) ...
$ cd Cython/Compiler/
$ find . -type f -print0 | xargs -0 -e grep -nH -e
TemplateTransform.temp_name_counter
./ParseTreeTransforms.py:549: TemplateTransform.temp_name_counter += 1
./ParseTreeTransforms.py:550: handle = "__tmpvar_%d" %
TemplateTransform.temp_name_counter
./TreeFragment.py:122: TemplateTransform.temp_name_counter += 1
./TreeFragment.py:123: handle = "__tmpvar_%d" %
TemplateTransform.temp_name_counter
Is the .temp_name_counter counter ever decremented? Could be this the
root of the problem?
--
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594
More information about the Cython-dev
mailing list