Skip to content

Allow for additional arguments in custom test functions #63

@lordjabez

Description

@lordjabez

I'm finding myself using custom test functions a lot, many of which are nearly identical, and writing the same lambda function over and over is getting tedious.

It'd be really handy if one could pass additional arguments to these functions, so that one could do this:

def case_insensitive_match(a, b):
    return a.casefold() == b.casefold()

db.where('value').test(case_insensitive_match, my_val)
db.where('value').test(case_insensitive_match, my_other_val)

If you're keen on having this ability too, I'd be happy to code it up and submit a pull request.

P.S. Just discovered this library, and love it so far!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions