Stubbing function
Charles G Waldman
cgw at fnal.gov
Fri Jan 14 13:42:08 EST 2000
More information about the Python-list mailing list
Fri Jan 14 13:42:08 EST 2000
- Previous message (by thread): Stubbing function
- Next message (by thread): Tcl/Tk Path problems in Python 1.5.2 installation
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Timothy Grant writes:
> Is there a "standard" method of stubbing functions in Tkinter?
>
> I would like to be able to use the "command=lambda:????" construct to
> stub my functions as I don't like creating functions with empty bodies
> just for stubbing purposes. I tried "command=lambda: pass" and that
> generated syntax errors, so I know that I'm missing something basic
> about how lambdas work, I just don't quite know what!
Note that
lambda: None
works just fine.
lambdas may not contain any statements, just functions and
expressions. For instance:
lambda x: print x
is illegal, wheras
lambda x: sys.stdout.write("%s\n"%x)
is allowed.
Hope this helps,
-cgw
- Previous message (by thread): Stubbing function
- Next message (by thread): Tcl/Tk Path problems in Python 1.5.2 installation
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list