What exactly is "pass"? What should it be?

Chris Angelico rosuav at gmail.com
Fri Nov 18 00:34:10 EST 2011


On Fri, Nov 18, 2011 at 4:07 PM, John Ladasky <ladasky at my-deja.com> wrote:
> One of my questions was: would there be any merit to having the Python "pass" token itself defined exactly as _pass() is defined above?

No, there wouldn't. The Python 'pass' statement is a special statement
that indicates a lack of anything to execute; a dummy function call
isn't this. What I would kinda like to see, though, is function
versions of many things. Your basic operators exist in the 'operator'
module, but the syntax is rather clunky; for comparison, Pike has
beautifully simple (if a little cryptic) syntax: back-tick followed by
the operator itself, very similar to the way C++ does operator
overloading.

In Python 2, back-tick has a special meaning. In Python 3, that
meaning is removed. Is the character now available for this
"function-version" syntax?

ChrisA



More information about the Python-list mailing list