Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue14674] Add link to RFC 4627 from json documentation

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Apr 26, 2012, 7:15 AM

Post #1 of 23 (124 views)
Permalink
[issue14674] Add link to RFC 4627 from json documentation

New submission from Serhiy Storchaka <storchaka [at] gmail>:

The json module documentation should give a link to RFC 4627 and explain the current implementation is different from it. For example, according to RFC 4627 only an object or an array can be top-level JSON element.

----------
assignee: docs [at] pytho
components: Documentation
messages: 159367
nosy: docs [at] pytho, storchaka
priority: normal
severity: normal
status: open
title: Add link to RFC 4627 from json documentation
type: enhancement
versions: Python 3.3

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14674>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Apr 27, 2012, 12:35 PM

Post #2 of 23 (120 views)
Permalink
[issue14674] Add link to RFC 4627 from json documentation [In reply to]

Changes by Éric Araujo <merwok [at] netwok>:


----------
keywords: +easy
nosy: +eric.araujo
stage: -> needs patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14674>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

May 6, 2012, 7:17 AM

Post #3 of 23 (116 views)
Permalink
[issue14674] Add link to RFC 4627 from json documentation [In reply to]

Changes by Ezio Melotti <ezio.melotti [at] gmail>:


----------
nosy: +ezio.melotti
versions: +Python 2.7, Python 3.2

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14674>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

May 6, 2012, 9:22 AM

Post #4 of 23 (117 views)
Permalink
[issue14674] Add link to RFC 4627 from json documentation [In reply to]

Nurhusien Hasen <nurhusien.hasen27 [at] gmail> added the comment:

find python truste .net all serves

----------
nosy: +Nurhusien.Hasen

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14674>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

May 6, 2012, 10:19 AM

Post #5 of 23 (122 views)
Permalink
[issue14674] Add link to RFC 4627 from json documentation [In reply to]

Nurhusien Hasen <nurhusien.hasen27 [at] gmail> added the comment:

find python .org public all serves

On 5/6/12, Nurhusien Hasen <report [at] bugs> wrote:
>
> Nurhusien Hasen <nurhusien.hasen27 [at] gmail> added the comment:
>
> find python truste .net all serves
>
> ----------
> nosy: +Nurhusien.Hasen
>
> _______________________________________
> Python tracker <report [at] bugs>
> <http://bugs.python.org/issue14674>
> _______________________________________
>

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14674>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

May 6, 2012, 10:26 AM

Post #6 of 23 (118 views)
Permalink
[issue14674] Add link to RFC 4627 from json documentation [In reply to]

Changes by Ezio Melotti <ezio.melotti [at] gmail>:


----------
Removed message: http://bugs.python.org/msg160089

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14674>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

May 6, 2012, 10:26 AM

Post #7 of 23 (115 views)
Permalink
[issue14674] Add link to RFC 4627 from json documentation [In reply to]

Changes by Ezio Melotti <ezio.melotti [at] gmail>:


----------
Removed message: http://bugs.python.org/msg160098

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14674>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

May 6, 2012, 10:26 AM

Post #8 of 23 (117 views)
Permalink
[issue14674] Add link to RFC 4627 from json documentation [In reply to]

Changes by Ezio Melotti <ezio.melotti [at] gmail>:


----------
nosy: -Nurhusien.Hasen

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14674>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

May 14, 2012, 7:34 PM

Post #9 of 23 (116 views)
Permalink
[issue14674] Add link to RFC 4627 from json documentation [In reply to]

Chris Rebert <pybugs [at] rebertia> added the comment:

Draft docs patch. More cross-referencing. Analysis of deviations from RFC based on previous docs & the RFC.

Don't know if there are relevant, more precise implementation limitations that need to be mentioned.

If backported to 2.x, will need to cover encodings slightly more.

----------
keywords: +patch
nosy: +cvrebert
Added file: http://bugs.python.org/file25591/json.rst.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14674>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

May 14, 2012, 8:06 PM

Post #10 of 23 (115 views)
Permalink
[issue14674] Add link to RFC 4627 from json documentation [In reply to]

Changes by Chris Rebert <pybugs [at] rebertia>:


Added file: http://bugs.python.org/file25592/json.rst.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14674>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

May 15, 2012, 12:52 AM

Post #11 of 23 (114 views)
Permalink
[issue14674] Add link to RFC 4627 from json documentation [In reply to]

Chris Rebert <pybugs [at] rebertia> added the comment:

New revision per Éric's Rietveld feedback.

Sidenote: Is there any way to get notified of these reviews? I only saw it because I happened to click the "review" link on a lark.

----------
Added file: http://bugs.python.org/file25594/json.rst.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14674>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

May 15, 2012, 1:22 AM

Post #12 of 23 (115 views)
Permalink
[issue14674] Add link to RFC 4627 from json documentation [In reply to]

Chris Rebert <pybugs [at] rebertia> added the comment:

The "import json"s were left for uniformity with the other code samples in the module's docs.


Also, here's what the pedantically-strict recipes might look like:

def _reject_inf_nan(string):
if string in {'-Infinity', 'Infinity', 'NaN'}:
raise ValueError("JSON does not allow infinite or NaN number values")

def _reject_dupe_keys(pairs):
obj = {}
for key, value in pairs:
if key in pairs:
raise ValueError("Name %s repeated in an object" % repr(key))
obj[key] = value
return obj

def strict_loads(string):
result = loads(string, parse_constant=_reject_inf_nan, object_pairs_hook=_reject_dupe_keys)
if not isinstance(result, (dict, list)):
raise ValueError("The top-level entity of the JSON text was not an object or an array")
return result


def strict_dumps(obj):
if not isinstance(obj, (dict, list)):
raise TypeError("The top-level object of a JSON text must be a dict or a list")
return dumps(obj, allow_nan=False)

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14674>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

May 15, 2012, 1:26 AM

Post #13 of 23 (115 views)
Permalink
[issue14674] Add link to RFC 4627 from json documentation [In reply to]

Ezio Melotti <ezio.melotti [at] gmail> added the comment:

Thanks for the patch, I left more comments on the review page.

IMHO it would be better to list the differences in a bullet list and expand later, rather than having a section for the parser and one for the generator.
AFAIU the differences are:
* top-level scalar values are accepted/generated;
* inf and nan are accepted/generated;
* unicode strings (rather than utf-8) are produced/consumed;
* duplicate keys are accepted, and the only the last one is used;

You can then add examples and explain "workarounds", either inline or after the list (I don't think it's necessary to add the snippets you posted in the last message though).


> Sidenote: Is there any way to get notified of these reviews?

In theory you should get notifications, in practice it doesn't always work. We are still working on make it better.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14674>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

May 15, 2012, 1:33 AM

Post #14 of 23 (116 views)
Permalink
[issue14674] Add link to RFC 4627 from json documentation [In reply to]

Chris Rebert <pybugs [at] rebertia> added the comment:

Further copyediting.

----------
Added file: http://bugs.python.org/file25595/json.rst.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14674>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

May 15, 2012, 2:16 AM

Post #15 of 23 (122 views)
Permalink
[issue14674] Add link to RFC 4627 from json documentation [In reply to]

Serhiy Storchaka <storchaka [at] gmail> added the comment:

> for key, value in pairs:
> if key in pairs:

"if key in obj:"?

----------
title: Link to & explain deviations from RFC 4627 in json module docs -> Add link to RFC 4627 from json documentation

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14674>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

May 15, 2012, 2:29 AM

Post #16 of 23 (115 views)
Permalink
[issue14674] Add link to RFC 4627 from json documentation [In reply to]

Serhiy Storchaka <storchaka [at] gmail> added the comment:

IMHO, it would be sufficient to have a simple bullet list of differences
and notes or warnings in places where Python can generate non-standard
JSON (top-level scalars, inf and nan, non-utf8 encoded strings).

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14674>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

May 15, 2012, 11:55 AM

Post #17 of 23 (117 views)
Permalink
[issue14674] Add link to RFC 4627 from json documentation [In reply to]

Chris Rebert <pybugs [at] rebertia> added the comment:

>> for key, value in pairs:
>> if key in pairs:
>
> "if key in obj:"?

Yes, obviously. :-) It wrote those very late at night.

@Ezio: These were per Éric's feedback but would be for a separate bug/patch.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14674>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

May 15, 2012, 5:24 PM

Post #18 of 23 (115 views)
Permalink
[issue14674] Add link to RFC 4627 from json documentation [In reply to]

Chris Rebert <pybugs [at] rebertia> added the comment:

Notification of any future Rietveld comments would be appreciated.

----------
Added file: http://bugs.python.org/file25603/json.rst.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14674>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

May 16, 2012, 12:53 AM

Post #19 of 23 (116 views)
Permalink
[issue14674] Add link to RFC 4627 from json documentation [In reply to]

Changes by Chris Rebert <pybugs [at] rebertia>:


Added file: http://bugs.python.org/file25606/json.rst.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14674>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

May 16, 2012, 12:53 AM

Post #20 of 23 (114 views)
Permalink
[issue14674] Add link to RFC 4627 from json documentation [In reply to]

Changes by Chris Rebert <pybugs [at] rebertia>:


Removed file: http://bugs.python.org/file25591/json.rst.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14674>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

May 16, 2012, 12:55 AM

Post #21 of 23 (114 views)
Permalink
[issue14674] Add link to RFC 4627 from json documentation [In reply to]

Changes by Chris Rebert <pybugs [at] rebertia>:


Removed file: http://bugs.python.org/file25592/json.rst.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14674>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

May 20, 2012, 3:50 PM

Post #22 of 23 (115 views)
Permalink
[issue14674] Add link to RFC 4627 from json documentation [In reply to]

Chris Rebert <pybugs [at] rebertia> added the comment:

So, does the refactored patch need any further revising, or is it good to go?

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14674>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

May 21, 2012, 2:13 PM

Post #23 of 23 (94 views)
Permalink
[issue14674] Add link to RFC 4627 from json documentation [In reply to]

Éric Araujo <merwok [at] netwok> added the comment:

A message should have been sent to pybugs [at] rebertia

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14674>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.