Re: [Python-Dev] Use an empty def as a lambda

2013-09-21 Thread Ryan
] On Behalf Of Ben Gift Sent: Thursday, September 19, 2013 1:54 PM To: python-dev@python.org Subject: [Python-Dev] Use an empty def as a lambda I think the lambda keyword is difficult to understand for many people. It would be more pythonic to use an empty def call instead. For instance

Re: [Python-Dev] Use an empty def as a lambda

2013-09-21 Thread R. David Murray
On Sat, 21 Sep 2013 12:55:20 -0500, Ryan rym...@gmail.com wrote: Westley Martínez aniko...@gmail.com wrote: 'def' is no more ambiguous than 'lambda', and is in fact more ambiguous, for 'def' doesn't lend itself to anything other than the word define, whilst 'lambda' can only mean lambda

Re: [Python-Dev] Use an empty def as a lambda

2013-09-21 Thread Westley Martínez
Subject: Re: [Python-Dev] Use an empty def as a lambda Change def to func? That's the worst idea I've heard yet. Def is already there; why break all existing code just for a word? Westley Martínez aniko...@gmail.com wrote: 'def' is no more ambiguous than 'lambda', and is in fact more

Re: [Python-Dev] Use an empty def as a lambda

2013-09-21 Thread Ben Finney
Westley Martínez aniko...@gmail.com writes: My reasoning is that we use class to make classes, lambda to make lambda functions, and def to make--well not defs--functions, which doesn't really make sense to me. Your reasoning is flawed. There is no such thing in Python as a “lambda function”.

Re: [Python-Dev] Use an empty def as a lambda

2013-09-21 Thread Westley Martínez
-Original Message- From: Python-Dev [mailto:python-dev-bounces+anikom15=gmail@python.org] On Behalf Of Ben Finney Sent: Saturday, September 21, 2013 12:56 PM To: python-dev@python.org Subject: Re: [Python-Dev] Use an empty def as a lambda Westley Martínez aniko...@gmail.com

Re: [Python-Dev] Use an empty def as a lambda

2013-09-21 Thread Steven D'Aprano
Guys, this thread is not Python-Dev territory. It should have gone to Python-Ideas. I repeat what I posted two days ago: Proposals for changes to syntax and functionality are normally expected to gather feedback on python-ideas before coming to python-dev for final approval or

Re: [Python-Dev] Use an empty def as a lambda

2013-09-20 Thread Westley Martínez
to understand mechanics. -Original Message- From: Python-Dev [mailto:python-dev-bounces+anikom15=gmail@python.org] On Behalf Of Ben Gift Sent: Thursday, September 19, 2013 1:54 PM To: python-dev@python.org Subject: [Python-Dev] Use an empty def as a lambda I think the lambda keyword

Re: [Python-Dev] Use an empty def as a lambda

2013-09-20 Thread Lennart Regebro
On Thu, Sep 19, 2013 at 10:54 PM, Ben Gift benhg...@gmail.com wrote: I think the lambda keyword is difficult to understand for many people. It would be more pythonic to use an empty def call instead. I agree, but that ship has sailed, at least until the time when Python 2 is dead. I don't want

Re: [Python-Dev] Use an empty def as a lambda

2013-09-19 Thread Xavier Morel
On 2013-09-19, at 23:17 , Nick Coghlan wrote: On 20 Sep 2013 07:04, Joe Pinsonault joe.pinsona...@gmail.com wrote: I think it's a great idea personally. It's explicit and obvious. lamda is too computer sciencey This suggestion has been made many times, occasionally with the associated

Re: [Python-Dev] Use an empty def as a lambda

2013-09-19 Thread Nick Coghlan
On 20 Sep 2013 07:04, Joe Pinsonault joe.pinsona...@gmail.com wrote: I think it's a great idea personally. It's explicit and obvious. lamda is too computer sciencey This suggestion has been made many times, occasionally with the associated must be contained in parentheses when used as an

[Python-Dev] Use an empty def as a lambda

2013-09-19 Thread Ben Gift
I think the lambda keyword is difficult to understand for many people. It would be more pythonic to use an empty def call instead. For instance this: words.sort(key = lambda x: x[2]) could look like this: words.sort(key = def (x): x[2]) It's obvious and explicit that we're creating an

Re: [Python-Dev] Use an empty def as a lambda

2013-09-19 Thread Joe Pinsonault
I think it's a great idea personally. It's explicit and obvious. lamda is too computer sciencey On Sep 19, 2013 1:55 PM, Ben Gift benhg...@gmail.com wrote: I think the lambda keyword is difficult to understand for many people. It would be more pythonic to use an empty def call instead. For

Re: [Python-Dev] Use an empty def as a lambda

2013-09-19 Thread Alexander Belopolsky
On Thu, Sep 19, 2013 at 4:54 PM, Ben Gift benhg...@gmail.com wrote: It would be more pythonic to use an empty def call instead. No, it won't. Python draws a very strong distinction between expressions and statements. This line has been blurred somewhat with the advent of comprehensions and

Re: [Python-Dev] Use an empty def as a lambda

2013-09-19 Thread Ryan Gonzalez
Nice idea, BUT... Not sure how a parser addition that supports it would go. Imagine this: if you did a one-line function: def test(x): print(x) Python could interpret it two ways: `def` `name` `lparen` `name` `rparen` `colon`... OR, it could see it as a lambda-like thingamajig and throw a

Re: [Python-Dev] Use an empty def as a lambda

2013-09-19 Thread Steven D'Aprano
On Thu, Sep 19, 2013 at 01:54:08PM -0700, Ben Gift wrote: I think the lambda keyword is difficult to understand for many people. It would be more pythonic to use an empty def call instead. Hi Ben, and welcome! Is this your first post? I'm afraid I don't recognise your name. I think this