Making Non Callable Objects Callable

Making Non Callable Objects Callable

Post by exiqui » Thu, 09 Oct 2008 02:35:46


I am trying to figure out if there is a way to make an object in
python callable, modules in particular. I wrongly assume that defining
'__call__' in the the objects __dict__ would work. Any help would be
appreciated.
 
 
 

Making Non Callable Objects Callable

Post by Christian » Thu, 09 Oct 2008 02:56:36


No, that doesn't work. Several magic methods (__*__) aren't looked up in
__dict__ or through __getattr__().

Christian

 
 
 

Making Non Callable Objects Callable

Post by exiqui » Thu, 09 Oct 2008 03:02:20


Thanks.
 
 
 

Making Non Callable Objects Callable

Post by exiqui » Thu, 09 Oct 2008 03:02:30


Thanks.