Larry Bates a écrit :
Bruno Desthuilliers wrote:
Bruno Desthuilliers a écrit :
Larry Bates a écrit :
(snip)
IMHO it reads better if you use the __call__ method of the class to return the value

IMHO, it makes no sense at all to abuse the __call__ magic method here.

Sorry - after a more careful re-read of other posts in the thread, it might make sense, given the use case :

condition = FolderInUse(core)
if condition.true_for(folder):
   # code here


but then, a plain function (or a partial) might be even better - that is, if the FolderInUse class doesn't have other responsabilities.



Sorry but I respectfully disagree that this is "abuse" of the __call__ method.

As long as we respectfully agree to disagree...

!-)

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to