from future import pass_function

Ian Kelly ian.g.kelly at gmail.com
Thu Jul 26 17:18:28 EDT 2012


On Thu, Jul 26, 2012 at 2:48 PM, John Ladasky
<john_ladasky at sbcglobal.net> wrote:
> On Wednesday, July 25, 2012 1:40:45 AM UTC-7, Ulrich Eckhardt wrote:
>> Hi!
>>
>> I just had an idea, it occurred to me that the pass statement is pretty
>> similar to the print statement, and similarly to the print() function,
>> there could be a pass() function that does and returns nothing.
>
> I had very similar thoughts about eight months ago, and posted them here:
>
> https://groups.google.com/forum/?fromgroups#!topic/comp.lang.python/CB_5fek2b8A
>
> I'm no computer science guru, but the idea that pass should be a function rather than a statement continues to appeal to me.  As you can see, I actually wrote just such a function so that I could use it as an argument in my code.

As long as 1) the name can't be reassigned (like None) and 2) the
compiler is able to optimize it out when used by itself as a statement
(to avoid incurring the expense of a common but pointless name
lookup), then I kind of agree.  The added complexity of those two
restrictions detracts a bit from the appeal to elegance, though.



More information about the Python-list mailing list