On Wednesday, September 3, 2014 7:19:07 PM UTC-7, Ned Batchelder wrote:
> Typically, you need to decide explicitly on a serialized representation
> for your data. Even if it's JSON, you need to decide what that JSON
> looks like. Then you need to write code that converts the JSON-able
> data
On 9/6/2014 12:32 PM, MRAB wrote:
On 2014-09-06 01:20, Chris Angelico wrote:
On Sat, Sep 6, 2014 at 3:04 AM, MRAB
wrote:
JSON has 'true' and 'false'.
Python has 'True' and 'False'.
Therefore, if you want it to be able to drop it into Python's REPL,
it won't be compatible with JSON anyway! (W
On 9/6/14 12:32 PM, MRAB wrote:
On 2014-09-06 01:20, Chris Angelico wrote:
On Sat, Sep 6, 2014 at 3:04 AM, MRAB
wrote:
JSON has 'true' and 'false'.
Python has 'True' and 'False'.
Therefore, if you want it to be able to drop it into Python's REPL,
it won't be compatible with JSON anyway! (Wel
On 2014-09-06 01:20, Chris Angelico wrote:
On Sat, Sep 6, 2014 at 3:04 AM, MRAB
wrote:
JSON has 'true' and 'false'.
Python has 'True' and 'False'.
Therefore, if you want it to be able to drop it into Python's REPL,
it won't be compatible with JSON anyway! (Well, not unless you
define 'true' a
On Sat, Sep 6, 2014 at 3:04 AM, MRAB wrote:
> JSON has 'true' and 'false'.
>
> Python has 'True' and 'False'.
>
> Therefore, if you want it to be able to drop it into Python's REPL, it
> won't be compatible with JSON anyway! (Well, not unless you define
> 'true' and 'false' first.)
This is a new
On 5-9-2014 19:16, Marko Rauhamaa wrote:
> Thus, ast.literal_eval() is superior to anything JSON has to offer.
Incidentally,
I've made a serialization library based on Python's literal expressions.
It uses ast.literal_eval() to deserialize, and a bit of custom code to
serialize Python
objects:
Ned Batchelder :
> I see what you mean about JSON, but you are mistaken about HTTP and
> XML. Neither of them dictates the encoding of the data, and both of
> them offer ways to declare the encoding. This means XML parsers must
> be prepared for many different encodings.
You can rest assured that
On 9/5/14 2:04 PM, Marko Rauhamaa wrote:
Ned Batchelder :
I don't understand how JSON has flopped? The parser may be a bit more
complex (but not much, it isn't hard to examine the first few bytes),
but you're using off-the-shelf parsers anyway, so why are you
concerned by this?
There are occa
Ned Batchelder :
> I don't understand how JSON has flopped? The parser may be a bit more
> complex (but not much, it isn't hard to examine the first few bytes),
> but you're using off-the-shelf parsers anyway, so why are you
> concerned by this?
There are occasions where you need to take shortcut
On 9/5/14 1:16 PM, Marko Rauhamaa wrote:
MRAB :
Therefore, if you want it to be able to drop it into Python's REPL, it
won't be compatible with JSON anyway! (Well, not unless you define
'true' and 'false' first.)
Sigh. I was so hopeful JSON would be great. Unfortunately, it flopped by
requiri
MRAB :
> Therefore, if you want it to be able to drop it into Python's REPL, it
> won't be compatible with JSON anyway! (Well, not unless you define
> 'true' and 'false' first.)
Sigh. I was so hopeful JSON would be great. Unfortunately, it flopped by
requiring the parser to heuristically support
On 2014-09-04 06:17, Chris Angelico wrote:
On Thu, Sep 4, 2014 at 9:39 AM, MRAB wrote:
I occasionally think about a superset of JSON, called, say, "pyson" ...
ah, name already taken! :-(
While I'm somewhat sympathetic to the concept, there are some parts of
your description that I disagree wi
On Fri, Sep 5, 2014 at 2:38 PM, Dan Sommers wrote:
> On Thu, 04 Sep 2014 15:17:17 +1000, Chris Angelico wrote:
>
>> On Thu, Sep 4, 2014 at 9:39 AM, MRAB wrote:
>
>>> The key of a dict could also be int, float, or tuple.
>>
>> Yes! Yes! DEFINITELY do this!! Ahem. Calm down a little, it's not that
On Thu, 04 Sep 2014 15:17:17 +1000, Chris Angelico wrote:
> On Thu, Sep 4, 2014 at 9:39 AM, MRAB wrote:
>> The key of a dict could also be int, float, or tuple.
>
> Yes! Yes! DEFINITELY do this!! Ahem. Calm down a little, it's not that
> outlandish an idea...
Using floats is a bad idea. Consi
On 2014-09-04 06:17, Chris Angelico wrote:> On Thu, Sep 4, 2014 at 9:39
AM, MRAB wrote:
>> I occasionally think about a superset of JSON, called, say, "pyson"
>> ... ah, name already taken! :-(
>
> While I'm somewhat sympathetic to the concept, there are some parts
> of your description that I di
On Thu, Sep 4, 2014 at 9:39 AM, MRAB wrote:
> I occasionally think about a superset of JSON, called, say, "pyson" ...
> ah, name already taken! :-(
While I'm somewhat sympathetic to the concept, there are some parts of
your description that I disagree with. Am I misreading something? Are
there ty
1) There are, if you want to mess around with them, ways to make pickle
"smarter" about class stuff:
https://docs.python.org/2/library/pickle.html#pickling-and-unpickling-normal-class-instances
. I've never worked with any of this stuff (and people don't seem to like
pickle all that much), and
On 9/3/14 6:30 PM, Josh English wrote:
On Wednesday, September 3, 2014 1:53:23 PM UTC-7, Ned Batchelder wrote:
Pickle (and it looks like jsonpickle) does not invoke the class'
__init__ method when it reconstitutes objects. Your new __init__ is not
being run, so new attributes it defines are no
On Thu, 04 Sep 2014 00:39:07 +0100, MRAB wrote:
> It would add tuples, delimited by (...), which are not used otherwise
> (no expressions):
I guess <> and () are both unused as delims by json at present.
I like the idea of other key types than string.
--
Denis McMahon, denismfmcma...@gmail.com
On 2014-09-03 23:30, Josh English wrote:
On Wednesday, September 3, 2014 1:53:23 PM UTC-7, Ned Batchelder
wrote:
Pickle (and it looks like jsonpickle) does not invoke the class'
__init__ method when it reconstitutes objects. Your new __init__
is not being run, so new attributes it defines are
On Wednesday, September 3, 2014 1:53:23 PM UTC-7, Ned Batchelder wrote:
> Pickle (and it looks like jsonpickle) does not invoke the class'
> __init__ method when it reconstitutes objects. Your new __init__ is not
> being run, so new attributes it defines are not being created.
>
> This is one o
On 9/3/14 4:32 PM, Josh English wrote:
I am using jsonpickle to store instances of an object into separate data files.
If I make any changes to the original class definition of the object, when I
recreate my stored instances, they are recreated using the original class
definition, so any new a
22 matches
Mail list logo