Re: [Cython] default parameter values in python function with class variables

2008-05-17 Thread Greg Ewing
Johannes Wienke wrote: class Bar(object): > > ... CONST = 25 > ... def foo(self, value=CONST): > ... print value > ... > > test.pyx:6:29: undeclared name not builtin: CONST This seems to work fine with the current Pyrex. -- Greg _

Re: [Cython] default parameter values in python function with class variables

2008-05-17 Thread Dag Sverre Seljebotn
Johannes Wienke wrote: > Hi, > > there seems to be a sematic difference between cython and native python > in the use of defaults and class variables. Consider the following example: > class Bar(object): > ... CONST = 25 > ... def foo(self, value=CONST): > ... print value >

[Cython] default parameter values in python function with class variables

2008-05-17 Thread Johannes Wienke
Hi, there seems to be a sematic difference between cython and native python in the use of defaults and class variables. Consider the following example: >>> class Bar(object): ... CONST = 25 ... def foo(self, value=CONST): ... print value ... >>> b = Bar() >>> b.foo() 25 Compiling