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
_
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
>
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