The new Storage in trunk is experimental. It may go away. Yet I think
the problems you refer to have been solved. Can you please try trunk
again and confirm?

Massimo

On Jun 2, 9:57 am, Ross Peoples <[email protected]> wrote:
> I just updated my trunk only to find several scripts not working properly
> and acting strangely. I thought it was a change made to MSSQL, but I have
> narrowed down the problem to revision 1980 titled, 'many semplifications'. A
> change made to storage.py's __getattr__() function is causing the problem.
>
> The old function used to read:
>
>     def __getattr__(self, key):
>         if key in self:
>             return self[key]
>         else:
>             return None
>
> That means that if you create a new Storage object like so:
>
> data = Storage()
> data.foo = 'bar'
>
> And you tried to access a field that didn't exist:
>
> return data.some_field
>
> This would return None. However, the new __getattr__ now reads:
>
>     def __getattr__(self,key):
>         if not key in self:
>             self[key] = Storage()
>         return self[key]
>
> So the same exact code would return <Storage {}> instead of None.
>
> This is causing a lot of problems for me, as I rely on the Storage object
> throughout my application.

Reply via email to