jdf / Processing.py-Bugs

A home for all bugs and feature requests about Python Mode for the Processing Development Environment.
41 stars 8 forks source link

Lambda expression generates error #162

Closed gratefulfrog closed 8 years ago

gratefulfrog commented 8 years ago

I have come across this strange bug:

def setup():
    f = lambda x: print(x)
    f(12)

results in this error referring to the line with the lambda processing.app.SketchException: Maybe there's an unclosed paren or quote mark somewhere before this line?

But this work-around runs ok:

def setup():
    f = lambda x: p(x)
    f(12)

def p(x):
    print(x)

Both work in python3.

As you can see, I'm working in processing.py all day every day! Ciao, Bob

jdf commented 8 years ago

Python Mode is Python 2.7, not Python 3.

gratefulfrog commented 8 years ago

oh, sorry...

On Fri, May 13, 2016 at 3:45 PM, Jonathan Feinberg <notifications@github.com

wrote:

Closed #162 https://github.com/jdf/Processing.py-Bugs/issues/162.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/jdf/Processing.py-Bugs/issues/162#event-659929371