@@ -3059,7 +3059,7 @@ Object doMapping(Object klass, PHashingCollection obj,
3059
3059
return factory ().createMappingproxy (klass , getStorage .execute (obj ));
3060
3060
}
3061
3061
3062
- @ Specialization (guards = {"isSequence (frame, obj, lib)" , "!isBuiltinMapping(obj)" }, limit = "1" )
3062
+ @ Specialization (guards = {"isMapping (frame, obj, lib)" , "!isBuiltinMapping(obj)" }, limit = "1" )
3063
3063
Object doMapping (VirtualFrame frame , Object klass , PythonObject obj ,
3064
3064
@ Cached ("create()" ) HashingStorage .InitNode initNode ,
3065
3065
@ SuppressWarnings ("unused" ) @ CachedLibrary ("obj" ) PythonObjectLibrary lib ) {
@@ -3072,7 +3072,7 @@ Object doMissing(Object klass, PNone none) {
3072
3072
throw raise (TypeError , ErrorMessages .MISSING_D_REQUIRED_S_ARGUMENT_S_POS , "mappingproxy()" , "mapping" , 1 );
3073
3073
}
3074
3074
3075
- @ Specialization (guards = {"!isSequence (frame, obj, lib)" , "!isNoValue(obj)" }, limit = "1" )
3075
+ @ Specialization (guards = {"!isMapping (frame, obj, lib)" , "!isNoValue(obj)" }, limit = "1" )
3076
3076
Object doInvalid (@ SuppressWarnings ("unused" ) VirtualFrame frame , @ SuppressWarnings ("unused" ) Object klass , Object obj ,
3077
3077
@ SuppressWarnings ("unused" ) @ CachedLibrary ("obj" ) PythonObjectLibrary lib ) {
3078
3078
throw raise (TypeError , ErrorMessages .ARG_MUST_BE_S_NOT_P , "mappingproxy()" , "mapping" , obj );
@@ -3082,11 +3082,14 @@ protected static boolean isBuiltinMapping(Object o) {
3082
3082
return o instanceof PHashingCollection ;
3083
3083
}
3084
3084
3085
- protected boolean isSequence (VirtualFrame frame , Object o , PythonObjectLibrary library ) {
3085
+ protected boolean isMapping (VirtualFrame frame , Object o , PythonObjectLibrary library ) {
3086
3086
PythonContext context = getContextRef ().get ();
3087
+ if (o instanceof PList || o instanceof PTuple ) {
3088
+ return false ;
3089
+ }
3087
3090
Object state = IndirectCallContext .enter (frame , context , this );
3088
3091
try {
3089
- return library .isSequence (o );
3092
+ return library .isMapping (o );
3090
3093
} finally {
3091
3094
IndirectCallContext .exit (frame , context , state );
3092
3095
}
0 commit comments