[Python-ideas] Another way to avoid clumsy lambdas, while adding new functionality

MRAB python at mrabarnett.plus.com
Wed Mar 5 05:06:38 CET 2014


On 2014-03-05 01:46, Cameron Simpson wrote:
> On 04Mar2014 17:23, David Mertz <mertz at gnosis.cx> wrote:
>> On Tue, Mar 4, 2014 at 4:06 PM, Cameron Simpson <cs at zip.com.au> wrote:
>> > On 04Mar2014 17:57, Ryan Gonzalez <rymg19 at gmail.com> wrote:
>> > > Only problem is that it looks a tad perlish...Of shellish.
>> >
>> > But worse, does nothing even remotely loke what that does in perl
>> > or shell (or basic or...).
> [...]
>> I think I could be +0 for a bit different spelling that *is* actually
>> shell-ish.  I.e. as a way to handle snippets, this doesn't seem so bad:
>>
>>   foo = 1
>>   a = $(foo + 1)
>
> Definitely nicer. Still irrationally uncomfortable about the "$" though.
>
> A thought, though it could break existing code (and nested tuples, alas):
>
>      a = (( foo + 1 ))
>
That's not a tuple. It's equivalent to:

      a = foo + 1

[snip]



More information about the Python-ideas mailing list