Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use opearator functions instead of our own where possible #106

Merged
merged 1 commit into from
Aug 5, 2024

Conversation

glatterf42
Copy link
Member

Today I learned that Python comes with the operator module. This provides various operators as functions, which made me think of db/filters.py, where we define several functions again like exact, which is equal to operator.eq.
This PR reduces possible errors and maintenance for us by replacing our functions with those from operator. Please note that more might be possible; there is e.g. operator.contains, but it's not a drop-in replacement for in_ (I tried, some tests failed) and I didn't want to spend too much time on this, so for now, it's not included here.

@glatterf42 glatterf42 added the enhancement New feature or request label Aug 2, 2024
@glatterf42 glatterf42 requested a review from meksor August 2, 2024 12:18
@glatterf42 glatterf42 self-assigned this Aug 2, 2024
Copy link
Contributor

@meksor meksor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@glatterf42 glatterf42 merged commit 0294bc0 into main Aug 5, 2024
10 checks passed
@glatterf42 glatterf42 deleted the enh/use-operator-functions branch August 5, 2024 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants