from future import pass_function

Ethan Furman ethan at stoneleaf.us
Thu Jul 26 23:23:02 CEST 2012


John Ladasky wrote:
> On Wednesday, July 25, 2012 9:32:33 PM UTC-7, Ethan Furman wrote:
> 
>> What code does `pass` run?  When do we pass parameters to `pass`?   When 
>> do we need to override `pass`?
>>
>> Answers:  None.  Never.  Still waiting for a reply from the OP for a use 
>> case.
> 
> When I brought up this same issue some months ago...
> 
> https://groups.google.com/forum/?fromgroups#!topic/comp.lang.python/CB_5fek2b8A
> 
> ...it wasn't because I wanted to pass parameters to "pass", it was because I wanted to define a do-nothing function as an optional behavior within another function.  In other words, I wanted to pass "pass."

That's a reasonable thing to want, and quite easily accomplished by 
passing `lambda: None`  or `lambda *args, **kwargs: None` instead.  I 
don't think this is difficult to do, nor common enough to justify making 
every other `pass` a time-consuming do-nothing operation, instead of 
just a do-nothing operation

~Ethan~



More information about the Python-list mailing list