Re: Changing ' to " in printed representation of dictionaries

2010-12-02 Thread MRAB
On 02/12/2010 23:06, Burton Samograd wrote: Hello, I was wondering if there was a way to change the quote character for keys in string representation of dictionaries, so that they will be JSON equivalent. For example: x = { 'x': 1, 'y': 2 } { 'x': 1, 'y': 2 } `x` "{ 'x': 1, 'y': 2 }" # clos

Re: Changing ' to " in printed representation of dictionaries

2010-12-02 Thread Terry Reedy
On 12/2/2010 6:06 PM, Burton Samograd wrote: Hello, I was wondering if there was a way to change the quote character for keys in string representation of dictionaries, so that they will be JSON equivalent. For example: x = { 'x': 1, 'y': 2 } { 'x': 1, 'y': 2 } `x` "{ 'x': 1, 'y': 2 }" # clo

Re: Changing ' to " in printed representation of dictionaries

2010-12-02 Thread Emile van Sebille
On 12/2/2010 3:06 PM Burton Samograd said... Hello, I was wondering if there was a way to change the quote character for keys in string representation of dictionaries, so that they will be JSON equivalent. For example: x = { 'x': 1, 'y': 2 } { 'x': 1, 'y': 2 } `x` "{ 'x': 1, 'y': 2 }" # clo

Changing ' to " in printed representation of dictionaries

2010-12-02 Thread Burton Samograd
Hello, I was wondering if there was a way to change the quote character for keys in string representation of dictionaries, so that they will be JSON equivalent. For example: >>> x = { 'x': 1, 'y': 2 } { 'x': 1, 'y': 2 } >>> `x` "{ 'x': 1, 'y': 2 }" # close but not quite a JSON string >>> `x`.re