Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #69529 > unrolled thread

Ideas for Python 4

Started byRyan Gonzalez <rymg19@gmail.com>
First post2014-04-01 20:54 -0500
Last post2014-04-01 20:54 -0500
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  Ideas for Python 4 Ryan Gonzalez <rymg19@gmail.com> - 2014-04-01 20:54 -0500

#69529 — Ideas for Python 4

FromRyan Gonzalez <rymg19@gmail.com>
Date2014-04-01 20:54 -0500
SubjectIdeas for Python 4
Message-ID<mailman.8810.1396403705.18130.python-list@python.org>

[Multipart message — attachments visible in raw view] — view raw

I have a bunch of ideas I'd like to share for Python 4:

Use -- for comments instead of #.

Switch to <> for "not equal" instead of !=.

Remove indentation requirement:

-- Python 2&3
if x != y:
    return 7

-- Python 4
if x <> y:
    return 7
;;

Add multiline lambdas:

my_multiline_lambda = ll { return 7; }

Add implicit lambdas using a clear, simple, and concise syntax:

my_implicit_lambda = ??[0] + ??[1] if ??#? != 0
-- ?? = argument dictionary
-- ??#? = argument count

Add method chaining using even easier syntax:

a = SomeObject()
b = a->>>m2->>>m3->>>m4!!;;

-- Call m2, then m3, then m4, then return the resulting object

-- BTW, April Fools! This is ugly...

-- 
Ryan
If anybody ever asks me why I prefer C++ to C, my answer will be simple:
"It's becauseslejfp23(@#Q*(E*EIdc-SEGFAULT. Wait, I don't think that was
nul-terminated."

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web