Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Python lambdas

Name: Anonymous 2008-08-23 2:12

SyntaxError: lambda cannot contain assignment

Is there a practical reason for this? now i have to do this:

self.fig_can.mpl_connect('button_press_event',self.on_mpl_click)
def on_mpl_click(self,event):
    self.cur_axes = event.inaxes


instead of

        self.fig_can.mpl_connect('button_press_event', lambda event:self.cur_axes = event.inaxes)

Think of the keystrokes that could be saved here, simply because Guido doesn't want to mix functional and imperative in lambdas???

Name: Anonymous 2008-08-23 7:56

>>6
Scheme doesn't have a built-in object system as good as Python's, nor infix syntax, and most of all, Scheme doesn't have Python's standard and third party library.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List