Skip to content

Commit

Permalink
Add VersionSpecifiers::__contains__ for pyo3
Browse files Browse the repository at this point in the history
  • Loading branch information
konstin committed Oct 6, 2023
1 parent 74c297a commit c3933ea
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/version_specifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ impl VersionSpecifiers {
pub fn __len__(&self) -> usize {
self.0.len()
}

pub fn __contains__(&self, version: &PyVersion) -> bool {
self.contains(&version.0)
}
}

#[cfg(feature = "serde")]
Expand Down

0 comments on commit c3933ea

Please sign in to comment.