SHOW:
|
|
- or go back to the newest paste.
1 | import functools | |
2 | from decimal import Decimal | |
3 | from json import JSONEncoder | |
4 | ||
5 | def wrap_default(real_default): | |
6 | @functools.wraps(real_default) | |
7 | def wrapper(self, obj): | |
8 | - | print "aaa" |
8 | + | |
9 | return float(obj) | |
10 | return real_default(self, obj) | |
11 | return wrapper | |
12 | ||
13 | JSONEncoder.default = wrap_default(JSONEncoder.default) |