On 9/27/13, Olemis Lang <[email protected]> wrote:
> On 9/27/13, Anze Staric <[email protected]> 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

Reply via email to