bloodhound-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Olemis Lang <ole...@gmail.com>
Subject Re: ProductEnvironment constructor
Date Fri, 27 Sep 2013 16:05:14 GMT
On 9/27/13, Olemis Lang <olemis@gmail.com> wrote:
> On 9/27/13, Anze Staric <anze.staric@gmail.com> wrote:
>> Is there anything wrong with replacing
>>
>>          if not isinstance(env, trac.env.Environment):
>>               raise TypeError("Initializer must be called with " ...
>>
>> with
>>
>>         env = env.parent or env
>>
>> in ProductEnvironment constructor?
>
> I'd rather prefer to continue raising that error because ...
>
>> The assertion is there to prevent
>> nesting of ProductEnvironments, but this is still achieved with the
>> bottom version.
>
> ... that's not the only reason . By reviewing meta-class code you'll
> notice that instances of ProductEnvironment are cached considering
> initializer input parameters i.e. global env + prefix .
[...]

... I forgot to mention something important ... raising that error is
important so as to prevent LRU cache corruption .

-- 
Regards,

Olemis - @olemislc

Mime
View raw message