[Sqlalchemy-tickets] Issue #3093: MutableDict.setdefault doesn't return the new value (zzzeek/sqlal
Brought to you by:
zzzeek
|
From: Thomas H. <iss...@bi...> - 2014-06-24 07:49:12
|
New issue 3093: MutableDict.setdefault doesn't return the new value https://bitbucket.org/zzzeek/sqlalchemy/issue/3093/mutabledictsetdefault-doesnt-return-the Thomas Hervé: MutableDict.setdefault was recently changed to properly propagate changes, but it broke the dictionary interface by not returning the value. You should be able to do that with a dict: a = {} a.setdefault('b', 1) += 1 But with the current MutableDict behavior, it will fail with a NoneError. |