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:49

Python is stupid because of all that Guido's "benevolent dictator for life" crap. He likes to have "only one way to do" everything, which is why there will be no tail recursion, lambdas are discriminated, and at one point he even planned to remove the higher-order functions.
Also, >>5, with additions like this, wouldn't Python become a poor man's Lisp/Scheme? Just use the real deal, at least it's faster. And you'll have macros.

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