from future import pass_function
Ulrich Eckhardt
ulrich.eckhardt at dominolaser.com
Thu Jul 26 02:59:30 EDT 2012
Am 26.07.2012 04:38, schrieb Steven D'Aprano:
> The examples of pass-as-a-function shown by the Original Poster don't
> give any clue of what advantage there is to make pass a function.
Just read the text, it just struck me how similar pass and print are,
i.e. that neither actually needs to be a keyword. In some cases, I would
rather use "return" to replace "pass" though.
> It appears that the only reason for this suggested change is that he
> would rather write "pass()" instead of "pass", possibly because he
> thinks it looks cool.
I have no idea where you got the "cool" from, it is not in my posting. I
stated clearly that "I just had an idea", which should signal that I
haven't thought about this for any extended period of time. Then I asked
"What do you think?" exactly because I wanted to discuss this. No need
to get defensive. ;)
> (Actually, I reckon that what is driving this idea is that the OP is a
> beginner, and he's got a syntax error a few times from writing "pass()",
> and so he thought it would be easier to force other people to change tens
> or hundreds of thousands of Python programs to use "pass()" instead of
> "pass" than to just learn to stop putting parentheses after it.
So, and in order to force people to write parens or break their code I
have considered the possibility of importing that feature from
__future__ for those people that want it? Seriously, Steven, as much as
I like your regular contributions here, this time you had better logged
off and taken a walk, because you come across as _very_ arrogant here.
> But of course I could be wrong. Ulrich, if you are still reading this, if
> you have good examples for how pass as a function would actually be
> better, and how it will let you do things in Python that can't easily be
> done now, I'm very interested to hear them. Who knows, if the idea is
> good enough, some day it may even happen.
No there is nothing that you strictly need a pass() function for.
In summary, after reading this thread I have a lot of good arguments
against this idea and few arguments supporting the idea. In any case I
have many more arguments than those that I came up with myself, which is
exactly what I asked for.
Thanks to all that took part in this discussion!
Uli
More information about the Python-list
mailing list