[couchdb-python] push by matt.goo...@gmail.com - Deprecate built-in cjson support. on 2011-11-16 21:37 GMT

1 view
Skip to first unread message

couchdb...@googlecode.com

unread,
Nov 16, 2011, 4:38:09 PM11/16/11
to couchdb...@googlegroups.com
Revision: 7db07fb6811f
Author: Matt Goodall <matt.g...@gmail.com>
Date: Wed Nov 16 13:36:22 2011
Log: Deprecate built-in cjson support.
http://code.google.com/p/couchdb-python/source/detail?r=7db07fb6811f

Modified:
/couchdb/json.py

=======================================
--- /couchdb/json.py Tue Oct 11 07:03:26 2011
+++ /couchdb/json.py Wed Nov 16 13:36:22 2011
@@ -33,6 +33,7 @@

__all__ = ['decode', 'encode', 'use']

+import warnings
import os

_initialized = False
@@ -71,8 +72,8 @@
"""Set the JSON library that should be used, either by specifying a
known
module name, or by providing a decode and encode function.

- The modules "simplejson", "cjson", and "json" are currently supported
for
- the ``module`` parameter.
+ The modules "simplejson" and "json" are currently supported for the
+ ``module`` parameter.

If provided, the ``decode`` parameter must be a callable that accepts a
JSON string and returns a corresponding Python data structure. The
@@ -130,6 +131,10 @@
if _using == 'simplejson':
_init_simplejson()
elif _using == 'cjson':
+ warnings.warn("Builtin cjson support is deprecated. Please use
the "
+ "default or provide custom decode/encode functions "
+ "[2011-11-09].",
+ DeprecationWarning, stacklevel=1)
_init_cjson()
elif _using == 'json':
_init_stdlib()

Reply all
Reply to author
Forward
0 new messages