[New-bugs-announce] [issue14042] json.dumps() documentation is slightly incorrect.

Tom Christie report at bugs.python.org
Fri Feb 17 17:07:50 CET 2012


New submission from Tom Christie <tom at tomchristie.com>:

json.dumps() documentation is slightly incorrect.

http://docs.python.org/library/json.html#json.dumps

Reads:

  "If ensure_ascii is False, then the return value will be a unicode instance."

Should read:

  "If ensure_ascii is False, then the return value MAY BE be a unicode instance."

(Without the caps of course)

bash: python
Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05) 
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import json
>>> type(json.dumps({'a': 1}, ensure_ascii=False))
<type 'str'>

Tested against 2.6 and 2.7.

----------
components: Library (Lib)
messages: 153558
nosy: tomchristie
priority: normal
severity: normal
status: open
title: json.dumps() documentation is slightly incorrect.
type: behavior
versions: Python 2.6, Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14042>
_______________________________________


More information about the New-bugs-announce mailing list