LWN.net Logo

Pyjamas: writing AJAX applications in Python

Pyjamas: writing AJAX applications in Python

Posted Aug 30, 2009 13:18 UTC (Sun) by kleptog (subscriber, #1183)
In reply to: Pyjamas: writing AJAX applications in Python by drag
Parent article: Pyjamas: writing AJAX applications in Python

Actually, python's scoping is one of my biggest problems. The fact that the scoping of a variable can change in odd ways. Consider:

import time

def main():
   print time.clock()

   time = 1

main()
This program produces an error on the "print" line, yet if you comment out the "time = 1" line it works. This means you have to read a whole function before you can determine the scope of a variable. Being someone who controls scopes carefully so that typos are more easily found, it all feels weird.


(Log in to post comments)

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds