I’m working on a metrobus based project, and was curious how to define a flexible callback method that had a required parameter, and other keyword arguments.   I have used *args and **kwargs before, but wanted to really experiment on what I could do with them.   For metrobus, I’m only going to ‘require’ a ‘message’ parameter (single parameter callback function), but, I’ll have to use **kwargs on my declaration just so I can be a little more picky about what I receive each time.   Check out some experimentation:

 

Short URL: http://bit.ly/2wfR2oF