@@ -241,7 +241,13 @@ impl LookupKey {
241
241
obj : & Bound < ' py , PyAny > ,
242
242
kwargs : Option < & Bound < ' py , PyDict > > ,
243
243
) -> ValResult < Option < ( & ' s LookupPath , Bound < ' py , PyAny > ) > > {
244
- match self . _py_get_attr ( obj, kwargs) {
244
+ if let Some ( dict) = kwargs {
245
+ if let Ok ( Some ( item) ) = self . py_get_dict_item ( dict) {
246
+ return Ok ( Some ( item) ) ;
247
+ }
248
+ }
249
+
250
+ match self . simple_py_get_attr ( obj) {
245
251
Ok ( v) => Ok ( v) ,
246
252
Err ( err) => {
247
253
let error = py_err_string ( obj. py ( ) , err) ;
@@ -253,20 +259,6 @@ impl LookupKey {
253
259
}
254
260
}
255
261
256
- pub fn _py_get_attr < ' py , ' s > (
257
- & ' s self ,
258
- obj : & Bound < ' py , PyAny > ,
259
- kwargs : Option < & Bound < ' py , PyDict > > ,
260
- ) -> PyResult < Option < ( & ' s LookupPath , Bound < ' py , PyAny > ) > > {
261
- if let Some ( dict) = kwargs {
262
- if let Ok ( Some ( item) ) = self . py_get_dict_item ( dict) {
263
- return Ok ( Some ( item) ) ;
264
- }
265
- }
266
-
267
- self . simple_py_get_attr ( obj)
268
- }
269
-
270
262
pub fn json_get < ' a , ' data , ' s > (
271
263
& ' s self ,
272
264
dict : & ' a JsonObject < ' data > ,
0 commit comments