t238.py 370 B

12345678910111213141516
  1. # using obj[token] in JS doesn't work as a generic string dict
  2. # make sure to use *both* hasOwnProperty and then get it, otherwise object
  3. # builtins will return existence.
  4. def toString():
  5. print "wee"
  6. class stuff:
  7. def toString(self):
  8. return "waa"
  9. def valueOf(self):
  10. return "stuff"
  11. toString()
  12. s = stuff()
  13. print s.toString()
  14. print s.valueOf()