Home

Skip Montanaro a écrit :
>>> In this case there was a bug. Depending on inputs, sometimes obj
>>> initialized to a class, sometimes an instance of that class. (I fixed
>>> that too while I was at it.) The problem was that the use of __call__
>>> obscured the underlying bug by making the instance as well as the class
>>> callable.
>
>> I don't quite get the point here. A concrete example would be welcome.
>
> The bug went something like this:
>
> obj = some.default_class
> ...
> if some_other_rare_condition_met:
> ... several lines ...
> obj = some.other_class()
> ...
>
> Later,
>
> x = obj()
> x(...)

Ok, I see. A nasty one, indeed.

previous
next

Re: newb: glob on windows os.renames creates many nested folders
Re: placement new
Barton and Nackman's Scientific and Engineering C++
Re: The Modernization of Emacs: terminology buffer and keybinding
Re: sequantial processing of files of several directories
pozycjonowanie
tanie meble katowice
Veľkoobchod bižutéria
odwiew.elblag.pl
forum