DeprecationWarning: inspect.getargspec() is deprecated

Issue #129 new
Randy Barlow
created an issue


In Python 3.6, I see a few warnings like this:

  /usr/local/lib/python3.6/site-packages/dogpile/cache/ DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() or inspect.getfullargspec()
    args = inspect.getargspec(fn)

Comments (1)

  1. Michael Bayer repo owner was formatargspec that I had to vendor in SQLAlchemy, getargspec is easier as they have thankfully not deprecated getfullargspec().

    the code that codes into dogpile/util/ looks like:

    if py3k:
        ArgSpec = collections.namedtuple("ArgSpec",
                                         ["args", "varargs", "keywords", "defaults"])
        from inspect import getfullargspec as inspect_getfullargspec
        def inspect_getargspec(func):
            return ArgSpec(
        from inspect import getargspec as inspect_getfullargspec
        inspect_getargspec = inspect_getfullargspec
  2. Log in to comment