@@ -51,25 +51,7 @@ pyobject_native_type_core!(
5151) ;
5252
5353impl PyFrozenDict {
54- /// Creates a new frozendict from an iterable of key-value pairs.
55- ///
56- /// The iterable can be any Python object that yields (key, value) pairs,
57- /// such as another dict, a list of tuples, or any mapping-like object.
58- ///
59- /// # Examples
60- ///
61- /// ```
62- /// # use pyo3::prelude::*;
63- /// # use pyo3::types::PyFrozenDict;
64- /// # #[cfg(Py_3_15)]
65- /// # fn example() -> PyResult<()> {
66- /// # Python::try_attach(|py| -> PyResult<()> {
67- /// let fd = PyFrozenDict::new(py, vec![("a", 1), ("b", 2)])?;
68- /// assert_eq!(fd.len(), 2);
69- /// # Ok(())
70- /// # })
71- /// # }
72- /// ```
54+ /// Creates a new frozendict.
7355 pub fn new < ' py , T > ( py : Python < ' py > , iterable : T ) -> PyResult < Bound < ' py , PyFrozenDict > >
7456 where
7557 T : IntoPyObject < ' py > ,
@@ -92,22 +74,7 @@ impl PyFrozenDict {
9274 }
9375 }
9476
95- /// Creates a new empty frozendict.
96- ///
97- /// # Examples
98- ///
99- /// ```
100- /// # use pyo3::prelude::*;
101- /// # use pyo3::types::PyFrozenDict;
102- /// # #[cfg(Py_3_15)]
103- /// # fn example() -> PyResult<()> {
104- /// # Python::try_attach(|py| -> PyResult<()> {
105- /// let fd = PyFrozenDict::empty(py)?;
106- /// assert!(fd.is_empty());
107- /// # Ok(())
108- /// # })
109- /// # }
110- /// ```
77+ /// Creates a new empty frozendict
11178 pub fn empty ( py : Python < ' _ > ) -> PyResult < Bound < ' _ , PyFrozenDict > > {
11279 #[ cfg( Py_LIMITED_API ) ]
11380 {
0 commit comments