[issue29858] inspect.signature includes bound argument for wrappers around decorated bound methods
New submission from anton-ryzhov: If we wrap function with bound method, which is also a wrapper around function, `inspect.signature` will not do `skip_bound_arg`. It will use `inspect.unwrap` and pass by bound method from outer function to inner one. Reproduce: ``` import functools, inspect def decorator(func): @functools.wraps(func) def inner(*args): return func(*args) return inner class Foo(object): @decorator def bar(self, testarg): pass f = Foo() baz = decorator(f.bar) assert inspect.signature(baz) == inspect.signature(f.bar) ``` -- components: Library (Lib) messages: 289879 nosy: anton-ryzhov priority: normal severity: normal status: open title: inspect.signature includes bound argument for wrappers around decorated bound methods versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 ___ Python tracker <http://bugs.python.org/issue29858> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue29858] inspect.signature includes bound argument for wrappers around decorated bound methods
anton-ryzhov added the comment: Related to http://bugs.python.org/issue24298 -- ___ Python tracker <http://bugs.python.org/issue29858> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue29858] inspect.signature includes bound argument for wrappers around decorated bound methods
Changes by anton-ryzhov : -- pull_requests: +650 ___ Python tracker <http://bugs.python.org/issue29858> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26724] Serialize dict with non-string keys to JSON — unexpected result
New submission from anton-ryzhov: JSON doesn't allow to have non-sting keys in objects, so json.dumps converts its to string. But if several keys has one string representation — we'll get damaged result as follows: >>> import json >>> json.dumps({1: 2, "1": "2"}) '{"1": 2, "1": "2"}' I think it should raise ValueError in this case. I've tested this case on 2.7, 3.4 and on trunk version 3.6. -- components: Library (Lib) messages: 263108 nosy: anton-ryzhov priority: normal severity: normal status: open title: Serialize dict with non-string keys to JSON — unexpected result type: behavior versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6 ___ Python tracker <http://bugs.python.org/issue26724> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com