Message211585
OK well, let me just note what the issue is, and I think this is pretty backwards-incompatible, and additionally I really can't find any reasonable way of working around it except for just deleting __wrapped__. It would be nice if there were some recipe or documentation that could point people to how do do the following pattern:
import functools
import inspect
def my_wrapper(fn):
def wrapped(x, y, z):
return my_func(x, y)
wrapped = functools.update_wrapper(wrapped, fn)
return wrapped
def my_func(x, y):
pass
wrapper = my_wrapper(my_func)
# passes for 2.6 - 3.3, fails on 3.4
assert inspect.getargspec(wrapper) == (['x', 'y', 'z'], None, None, None), inspect.getargspec(wrapper)
basically in Alembic we copy out a bunch of decorated functions out somewhere else using inspect(), and that code relies upon seeing the wrappers list of arguments, not the wrapped. Not that Python 3.4's behavior isn't correct now, but this seems like something that might be somewhat common. |
|
Date |
User |
Action |
Args |
2014-02-19 01:38:12 | zzzeek | set | recipients:
+ zzzeek, georg.brandl, rhettinger, jcea, ncoghlan, ezio.melotti, michael.foord, lukasz.langa, python-dev |
2014-02-19 01:38:12 | zzzeek | set | messageid: <1392773892.03.0.0611120708892.issue17482@psf.upfronthosting.co.za> |
2014-02-19 01:38:12 | zzzeek | link | issue17482 messages |
2014-02-19 01:38:10 | zzzeek | create | |
|