# HG changeset patch # User Sylvain Thénault # Date 1268387437 -3600 # Node ID 56c16efedc51c9e0a467d04aa31a87760736f007 # Parent 2f75a8439338aeabffe61d6790bd5c0aff9bb3b7 deprecates merge_dicts diff -r 2f75a8439338 -r 56c16efedc51 utils.py --- a/utils.py Fri Mar 12 10:49:42 2010 +0100 +++ b/utils.py Fri Mar 12 10:50:37 2010 +0100 @@ -41,11 +41,6 @@ return type(str(clsname), (cls,), {'__autogenerated__': True}) -def merge_dicts(dict1, dict2): - """update a copy of `dict1` with `dict2`""" - dict1 = dict(dict1) - dict1.update(dict2) - return dict1 # use networkX instead ? @@ -294,6 +289,7 @@ __answer[0] = True return True + try: # may not be there if cubicweb-web not installed from simplejson import dumps, JSONEncoder @@ -321,6 +317,14 @@ # just return None in those cases. return None + +@deprecated('[3.7] merge_dicts is deprecated') +def merge_dicts(dict1, dict2): + """update a copy of `dict1` with `dict2`""" + dict1 = dict(dict1) + dict1.update(dict2) + return dict1 + from logilab.common import date _THIS_MOD_NS = globals() for funcname in ('date_range', 'todate', 'todatetime', 'datetime2ticks',