Skip to content

Commit 03f1aa8

Browse files
authored
remove some dead PyPy-specific code (#1329)
1 parent 4d20a1d commit 03f1aa8

File tree

1 file changed

+0
-54
lines changed

1 file changed

+0
-54
lines changed

src/input/input_python.rs

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -653,60 +653,6 @@ fn maybe_as_enum<'py>(v: &Bound<'py, PyAny>) -> Option<Bound<'py, PyAny>> {
653653
}
654654
}
655655

656-
#[cfg(PyPy)]
657-
static DICT_KEYS_TYPE: pyo3::sync::GILOnceCell<Py<PyType>> = pyo3::sync::GILOnceCell::new();
658-
659-
#[cfg(PyPy)]
660-
fn is_dict_keys_type(v: &Bound<'_, PyAny>) -> bool {
661-
let py = v.py();
662-
let keys_type = DICT_KEYS_TYPE
663-
.get_or_init(py, || {
664-
py.eval("type({}.keys())", None, None)
665-
.unwrap()
666-
.downcast::<PyType>()
667-
.unwrap()
668-
.into()
669-
})
670-
.bind(py);
671-
v.is_instance(keys_type).unwrap_or(false)
672-
}
673-
674-
#[cfg(PyPy)]
675-
static DICT_VALUES_TYPE: pyo3::sync::GILOnceCell<Py<PyType>> = pyo3::sync::GILOnceCell::new();
676-
677-
#[cfg(PyPy)]
678-
fn is_dict_values_type(v: &Bound<'_, PyAny>) -> bool {
679-
let py = v.py();
680-
let values_type = DICT_VALUES_TYPE
681-
.get_or_init(py, || {
682-
py.eval("type({}.values())", None, None)
683-
.unwrap()
684-
.downcast::<PyType>()
685-
.unwrap()
686-
.into()
687-
})
688-
.bind(py);
689-
v.is_instance(values_type).unwrap_or(false)
690-
}
691-
692-
#[cfg(PyPy)]
693-
static DICT_ITEMS_TYPE: pyo3::sync::GILOnceCell<Py<PyType>> = pyo3::sync::GILOnceCell::new();
694-
695-
#[cfg(PyPy)]
696-
fn is_dict_items_type(v: &Bound<'_, PyAny>) -> bool {
697-
let py = v.py();
698-
let items_type = DICT_ITEMS_TYPE
699-
.get_or_init(py, || {
700-
py.eval("type({}.items())", None, None)
701-
.unwrap()
702-
.downcast::<PyType>()
703-
.unwrap()
704-
.into()
705-
})
706-
.bind(py);
707-
v.is_instance(items_type).unwrap_or(false)
708-
}
709-
710656
#[cfg_attr(debug_assertions, derive(Debug))]
711657
pub struct PyArgs<'py> {
712658
pub args: Option<PyPosArgs<'py>>,

0 commit comments

Comments
 (0)