Re: [Python-Dev] PEP 8 modernisation

2013-08-02 Thread Alexander Shorin
On Fri, Aug 2, 2013 at 1:10 PM, Nick Coghlan wrote: > Lambda was almost removed in Python 3. > >> >> Using `dict` to store lambdas: >> >> > op = { 'add': lambda x,y: x*y, 'mul': lambda x, y: x+y} >> >> Shows the hack to bypass PEP8 guides. Do you like to see code above >> instead of: >> >> add =

Re: [Python-Dev] PEP 8 modernisation

2013-08-02 Thread Alexander Shorin
Hi Terry, On Fri, Aug 2, 2013 at 12:29 AM, Terry Reedy wrote: > def f(x): return 2*x > f = lambda x: 2*x > Three spaces is seldom a crucial difference. If the expression is so long it > go past the limit (whatever we decide it is), it can be wrapped. and if I have multiple lambda-like def`s it

Re: [Python-Dev] Lambda [was Re: PEP 8 modernisation]

2013-08-01 Thread Alexander Shorin
Hi Steven, On Thu, Aug 1, 2013 at 7:06 PM, Steven D'Aprano wrote: > Hi Alexander, > > On 02/08/13 00:48, Alexander Shorin wrote: >> >> Hi Ronald, >> >> I understand this, but I'm a bit confused about fate of lambdas with >> such guideline

Re: [Python-Dev] PEP 8 modernisation

2013-08-01 Thread Alexander Shorin
...and, if so, why lambda's?(: Without backward compatibility point I see that they are getting "unofficially" deprecated and their usage is dishonoured. -- ,,,^..^,,, On Thu, Aug 1, 2013 at 6:53 PM, Ronald Oussoren wrote: > > On 1 Aug, 2013, at 16:48, Alexander Shorin

Re: [Python-Dev] PEP 8 modernisation

2013-08-01 Thread Alexander Shorin
they are looks useless (or useful only for very trivial cases) -- ,,,^..^,,, On Thu, Aug 1, 2013 at 6:41 PM, Ronald Oussoren wrote: > > On 1 Aug, 2013, at 16:34, Alexander Shorin wrote: > >> Hi Nick, >> >> On Thu, Aug 1, 2013 at 4:44 PM, Nick Coghlan wrote: >>

Re: [Python-Dev] PEP 8 modernisation

2013-08-01 Thread Alexander Shorin
Hi Nick, On Thu, Aug 1, 2013 at 4:44 PM, Nick Coghlan wrote: > 9. Explicit guideline not to assign lambdas to names (use def, that's > what it's for) Even for propose to fit chars-per-line limit and/or to remove duplicates (especially for sorted groupby case)? -- ,,,^..^,,,