Skip to content

enhancements scope

DagSverreSeljebotn edited this page · 4 revisions
Clone this wiki locally

Currently in Cython, one can do


def f(x):
    print x

This doesn't work in Python. Also, if one does

def f(x):
    return x

f = math.sin
print f(10)

it doesn't do the same things as Python either.

We should probably at least simulate the correct behavior, without sacrificing the compile-time linking of module-level functions.

[:enhancements/scope/transformimpl: One approach to implementation]

This doesn't work either:

class Bar(object):
    CONST = 25
    def foo(self, value=CONST):
        print value

This gives a compile-time error.

Something went wrong with that request. Please try again.