[SciPy-Dev] usage of inspect.getargspec ?

Nathaniel Smith njs@pobox....
Thu Jan 5 22:35:18 CST 2012


On Thu, Jan 5, 2012 at 7:09 PM,  <josef.pktd@gmail.com> wrote:
> triggered by the recent commit, I started to look a bit more at
> inspect.getargspec
>
> https://github.com/scipy/scipy/commit/c9c2d66701583984589c88c08c478e2fc6d9f4ec#L1R1213
>
> Until now I have seen it mainly in convenience code were it makes it
> easier for users but that I usually don't use, in this case it is part
> of essential code.
>
> The main problem with inspect.getargspec is that it gets easily
> confused by `self` if it is an instance method and by keywords and
> flexible arguments.

I have to say, to me the main problem is that the resulting API is
really un-Pythonic and surprising. I would never expect a function to
behave differently just because I changed some meaningless details of
the *signature* of the callback that I pass in.

I would find this confusing and unidiomatic even in template-heavy
C++, never mind Python... explicit > implicit and all that.

-- Nathaniel


More information about the SciPy-Dev mailing list