Skip to content

ExitFunctionValidation: counts keyword-only and **kwargs parameters; raw ValueError for builtins #39

Closed

Description

@thorwhalen

Found in a post-merge review of #36. Now that the check runs, _has_min_num_of_arguments counts every parameter: lambda a, *, b, c, d: ... and lambda a, b, c, **kw: ... are accepted as __exit__ functions and then crash at exit with takes 1 positional argument but 4 were given. And a builtin with no inspectable signature (max) now raises a raw ValueError from inspect.signature instead of passing as before. Fix: count only positional parameters; treat an uninspectable callable as valid (we cannot tell).

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