Re: what's wrong with "lambda x : print x/60,x%60"




bonono@xxxxxxxxx wrote:
> rurpy@xxxxxxxxx wrote:
> > > and, as you just found out, a rather restrictive one
> > > at that.
> >
> > In part because Python's designers failed to make "print" a function
> > or provide an if-then-else expression.
> >
> Why would one need print in lambda ? I like ternary operator(and there
> is ugly work around though still 100% functional). But print ?

I dashed that last part off quickly, so I don't have a good reason.
Maybe to insert a debugging print temporarily?

.



Relevant Pages

  • Re: whats wrong with "lambda x : print x/60,x%60"
    ... >> I dashed that last part off quickly, so I don't have a good reason. ... > If one needs it for debugging, it raise an alarm bell if lambda is the ... > def debug: print x ... Prev by Date: ...
    (comp.lang.python)
  • Re: Casting problem
    ... For the same reason to use anonymous functions (at least one of the ... Actually I'm all-up for anonymous methods for delegates; ... abbreviated lambda syntax. ... delegates in one method call. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: What is "this" ?
    ... Is there a very good reason to use "this" ... John ... Prev by Date: ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Firefox - tip for printing pages
    ... but for some reason the Print to File radio button ... George ... Prev by Date: ...
    (comp.sys.acorn.apps)
  • Word 2003 wont open documents and gives the error "unavailable"
    ... A couple of days office started by refusing to open PPS. ... Can anyone think up a reason why this should happen all of a sudden? ... Prev by Date: ...
    (microsoft.public.word.application.errors)

Loading