Loading ...
Sorry, an error occurred while loading the content.

Re: [json] Digest Number 3

Expand Messages
  • Patrick D. Logan
    The following test works in my sandbox for json-py. I think it works in the release but I actually cannot get to sourceforge at the moment... Try adding this
    Message 1 of 1 , Aug 3, 2005
    • 0 Attachment
      The following test works in my sandbox for json-py. I think it works in the release but I actually cannot get to sourceforge at the moment...

      Try adding this to jsontest.py...

      def testReadWriteCopies(self):
      orig_obj = {'a':' " '}
      json_str = json.write(orig_obj)
      copy_obj = json.read(json_str)
      self.assertEqual(orig_obj, copy_obj)
      self.assertTrue(orig_obj == copy_obj)
      self.assertFalse(id(orig_obj) == id(copy_obj))

      Re: people asking about this being valid json... note the syntax above is for a Python object, not a json representation. The result should look something like...

      {"a":" \\" "}

      ..which is the json representation of the Python dictionary in the first line of the test.

      BTW -- to users of json-py -- after several weeks of vacation and extreme preoccupation with other duties I am finally working on some json-py fixes, especially in json.write which I don't use much so it really lacks attention.

      So thanks to the several people who've sent me fixes and improvements. They are on their way finally.

      -Patrick


      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.