On 27.07.20 16:01, Peter Moore wrote:

I have had a long standing unanswered question on on stackoverflow: is it 
possible to pass a function to a default parameter so that you could do in 
essence things like this.

def time_diff(target_time,  curr_time= lambda : datetime.now() ):
     return curr_time - target_time

There was a discussion about this topic recently:

https://mail.python.org/archives/list/[email protected]/thread/MILIX6HSW3PRUNWWP6BN2G2D7PXYFZJ7/

_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/4Z3L7P6OTLPU3JALRKN5MWGETREBDYY7/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to