strange behaviour with decorators.

Antoon Pardon apardon at forel.vub.ac.be
Wed Feb 9 06:41:45 EST 2005


Op 2005-02-09, Diez B. Roggisch schreef <deetsNOSPAM at web.de>:
>> Now although this behaviour was surprising after somethought
>> I think I may understand why things go wrong, but I certainly
>> don't understand the result I got. I would think an error like:
>> 
>> TypeError: call() takes exactly 2 arguments (1 given)
>> 
>> would have been more appropiate.
>> 
>> 
>> Am I missing something?
>> Is it a bug?
>> Maybe both?
>
> Maybe I'm missing something - but I exactly get that error if I don't use
> that try: except: of yours:

Ah, yes, the penny dropped. The try: except where there because
originally there were other statements I wanted to test and I
didn't want the raise exception by the inc(-2) stop the script.
I completely forget to consider it would also catch the
error I was expecting.

Thanks.

-- 
Antoon Pardon



More information about the Python-list mailing list