pluggy icon indicating copy to clipboard operation
pluggy copied to clipboard

deprecate passing classes as hookspecs, it shold be instances

Open RonnyPfannschmidt opened this issue 3 years ago • 3 comments

we currently have self magic in place to handle unbound methods and passed in classes

ass signature (see #359) handles the bound methods so much better, we should ensure hook-specs are instances not types, and then generally handle them that way

followup to https://github.com/pytest-dev/pluggy/pull/359#discussion_r936410218_

RonnyPfannschmidt avatar Aug 03 '22 09:08 RonnyPfannschmidt

Currently many hookspecs are actually modules... is the plan to force to move hookspec functions to methods of a class?

nicoddemus avatar Aug 03 '22 10:08 nicoddemus

@nicoddemus modules will still be allowed, but passing classes would be disallowed, instead they'd have to be instances (orf control of method vs bound method

it may be permissible to allow types that don't take arguments

RonnyPfannschmidt avatar Aug 03 '22 12:08 RonnyPfannschmidt

Currently we support modules, classes or instances, the plan is to support only modules or instances. Got it, thanks.

nicoddemus avatar Aug 03 '22 12:08 nicoddemus