Skip to content
This repository was archived by the owner on Aug 8, 2025. It is now read-only.
This repository was archived by the owner on Aug 8, 2025. It is now read-only.

backoff.on_predicate does not work for staticmethods #200

Description

@spokeydokeys

I'm decorating a staticmethod with backoff.on_predicate and when there is an error in the decorated methods I'm getting the error, TypeError: 'staticmethod' object is not callable. It seems that backoff is storing the static method unbound to the class and attempts to run the unbound descriptor rather than the embedded function.

I was able to get it to work locally by adding

target_fun = target.__func__ if isinstance(target, staticmethod) else target

in _sync.py (and doing something similar with the handlers).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions