Re: [Tutor] Passing functions as arguments to other functions

2016-09-29 Thread Ben Finney
boB Stepp writes: > So the impression I am getting is that a function name by itself (with > no parentheses) is the function *object*. Yes. The expression ‘func’ resolves to whatever object is referenced by that name; if it's a function object, you get that object. The expression ‘func(foo, bar

[Tutor] Passing functions as arguments to other functions

2016-09-29 Thread boB Stepp
I believe I understand the barebone mechanics on how to do this. But I do not understand the rationale of why Python does it the way it does. Say def f(g, *args): g(*args) def g(*args): # Do something. do_things = f(g, *args) is the outline of how I understand the mechanics of doing t

[Tutor] Testing print

2016-09-29 Thread boB Stepp
Testing output of print functions (Py 3). First off, is it worth it to do so? Second, it seems that prints are often intermingled with the main logic of a function and only serve to pass on a message to the user. For example, in an earlier thread ( Questions as to how to run the same unit test m