Does dict.update affect a function's argspec?
Posted
by sbox32
on Stack Overflow
See other posts from Stack Overflow
or by sbox32
Published on 2010-04-28T13:59:53Z
Indexed on
2010/04/28
14:03 UTC
Read the original article
Hit count: 170
import inspect class Test: def test(self, p, d={}): d.update(p) return d print inspect.getargspec(getattr(Test, 'test'))[3] print Test().test({'1':True}) print inspect.getargspec(getattr(Test, 'test'))[3]
I would expect the argspec for Test.test not to change but because of dict.update it does. Why?
© Stack Overflow or respective owner