How to avoid "f.close" (no parens) bug?

Peter Hansen peter at engcorp.com
Wed Feb 11 14:54:05 EST 2004


Dave Kuhlman wrote:
[snip]
>     myobject = MyClass()
>     test(myobject.some_method)
>     test(myobject.some_other_method)
> 
> In this example, we've used a method as a parameter.

Dave, the difference is that you are actually *using* the method
as a parameter, not just using it as an expression and throwing
away the result as in this case:

      myobject.some_method

-Peter



More information about the Python-list mailing list