functions without parentheses

Steven Bethard steven.bethard at gmail.com
Thu Jul 28 11:25:33 EDT 2005


Jerry He wrote:
> def examine(str):
>      .....
>      .....
> 
> Is there some way to define it so that I can call it
> like
> 
> examine "string" 
> instead of examine("string")? 

What do you want to happen when someone types:

     examine

???  Or better yet, what if you do something like:

     map(examine, list_of_strs)

???  Should examine be called with no arguments?  Or should it be passed 
as a function object to map?

STeVe



More information about the Python-list mailing list