Skip to content

Commit cb55eb2

Browse files
rust bindings: fix expose Selection to python (#10)
Summary: Pull Request resolved: #10 apparently you can't gave `#[pymethods]` twice. not clear why this is detected in the OSS build but passes locally :-/ Reviewed By: moonli Differential Revision: D75027440 fbshipit-source-id: 03719ae8a5a51fc75c530d6963c658e8bb0f956b
1 parent 7914499 commit cb55eb2

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

monarch_hyperactor/src/selection.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@ pub struct PySelection {
88
inner: Selection,
99
}
1010

11-
#[pymethods]
12-
impl PySelection {
13-
#[getter]
14-
fn __repr__(&self) -> String {
15-
format!("{:?}", self.inner)
16-
}
17-
}
18-
1911
impl From<Selection> for PySelection {
2012
fn from(inner: Selection) -> Self {
2113
Self { inner }
@@ -24,6 +16,11 @@ impl From<Selection> for PySelection {
2416

2517
#[pymethods]
2618
impl PySelection {
19+
#[getter]
20+
fn __repr__(&self) -> String {
21+
format!("{:?}", self.inner)
22+
}
23+
2724
#[classmethod]
2825
#[pyo3(name = "from_string")]
2926
pub fn parse(_cls: Bound<'_, PyType>, input: &str) -> PyResult<Self> {

0 commit comments

Comments
 (0)