On Nov 2, 2011, at 8:20 AM, Anthony wrote:

> How are you making use of None values in Storage keys?

I meant to ask the same thing, actually.

I *do* think it's a useful behavior of Python dicts that one can store None as 
a dictionary value. I struggle sometimes with Objective-C, in which you can't 
store nil in an NSArray or an NSDictionary.

> 
> On Wednesday, November 2, 2011 10:59:01 AM UTC-4, Carlos wrote:
> Hi,
> 
> I'm using web2py latest trunk on win7.
> 
> As soon as I applied the following changeset:
> 
>     ce20196cd7b895029ed667ecff505987ee83d727 - (ce20196cd7b8) storage patch
> 
> I got errors both in shell and web requests ...
> 
>     auth.settings.hmac_key = 'sha512:5fd2a4d2-d703-476c-8184-800b84e453b8'
>      File "C:\web2py\gluon\storage.py", line 199, in __setattr__
>         raise SyntaxError, 'setting key \'%s\' does not exist' % key
>     SyntaxError: setting key 'hmac_key' does not exist
> 
> If I reload the immediate prior changeset, everything works ok again.
> 
> Based on what I see in this change, you are now removing the Storage key also 
> via __setitem__ (in addition to __setattr__).
> 
> But I need a way to assign None to a Storage key, for which I was using: 
> mystorage['key'] = None (which did assign None and did not remove the key).
> 
> Now I would have no way to assign a None value to a Storage key?.
> 
> Plus the above error I get in Settings.
> 
> Can this change be reverted?, or what do you recommend instead?.
> 
> Thanks,
> 
>    Carlos
> 


Reply via email to