Production App Engine runs Python 2.5.  This is a good example of why
you should do your development on 2.5 too.

Try doing this instead:

  class Registry(dict):
      # your stuff....
  Registry = singleton(Registry)




Robert





On Mon, Dec 20, 2010 at 12:03, retif <[email protected]> wrote:
> why this code raises <type 'exceptions.SyntaxError'>: invalid syntax
> (main.py, line 15) ?
> problem is only on production server. dev_appserver works ok
>
> def main():
>
>   def singleton(cls):
>       instances = {}
>       def getinstance():
>           if cls not in instances:
>               instances[cls] = cls()
>           return instances[cls]
>       return getinstance
>
>   @singleton
>   class Registry(dict):
>       def set(self, key, value):
>           self[key] = value
>
> if __name__ == '__main__':
>  main()
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Google App Engine" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/google-appengine?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to