Newsgroups: comp.lang.python
From: rusi <rustompm...@gmail.com>
Date: Thu, 26 Jul 2012 08:01:56 -0700 (PDT)
Local: Thurs, Jul 26 2012 11:01 am
Subject: Re: from future import pass_function
On Jul 25, 1:40 pm, Ulrich Eckhardt <ulrich.eckha...@dominolaser.com>
wrote: > Hi!
Since many have said NO but I see no good reasons for this no yet,
> I just had an idea, it occurred to me that the pass statement is pretty
> Example:
here's mine: tl;dr version: Do-nothing statements are easy just do nothing, ie
Longer version:
Consider the if expression and the if statement. The if statement can
Consider the expression: (exp if cond) # no else
Now consider your suggestion:
So you are saying that None can serve as a "generic zero"?
Python 2.7.3rc2 (default, Apr 22 2012, 22:35:38)
>>> 0+3
Traceback (most recent call last):
3 >>> None+3 File "<stdin>", line 1, in <module> TypeError: unsupported operand type(s) for +: 'NoneType' and 'int' >>> None+[1,2,3]
Traceback (most recent call last):
File "<stdin>", line 1, in <module> TypeError: unsupported operand type(s) for +: 'NoneType' and 'list' asked. You see what youve asked for is moving pass from the statement world
A more laymanish example:
And out goes the baby with the bathwater!
So to come back to your proposal:
> there could be a pass() function that does and returns nothing.
does nothing: easy
returns nothing: impossible (None is not "nothing", its more like "error") You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||