Oh.. and the issue is that you can't do Class decorators this way in Python 2.5 (while you can do them in 2.6). Just google around for "class decorators" "python 2.5" .. to see potential work-arounds.
On Mon, Dec 20, 2010 at 1:04 PM, Eli Jones <[email protected]> wrote: > Make sure you are using the dev_appserver with python2.5 > > This code will work fine in 2.6.. but it breaks in 2.5.. thus, once you get > deployed to Appengine (which runs Python 2.5).. you will get the syntax > error. > > > On Sun, Dec 19, 2010 at 1:40 PM, 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]<google-appengine%[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.
