@@ -182,7 +182,7 @@ protected static boolean isDict(Object object, IsBuiltinClassProfile profile) {
182
182
}
183
183
}
184
184
185
- @ Builtin (name = __DICT__ , minNumOfPositionalArgs = 1 , maxNumOfPositionalArgs = 2 , isGetter = true , isSetter = true )
185
+ @ Builtin (name = __DICT__ , minNumOfPositionalArgs = 1 , maxNumOfPositionalArgs = 2 , isGetter = true )
186
186
@ GenerateNodeFactory
187
187
public abstract static class ModuleDictNode extends PythonBinaryBuiltinNode {
188
188
@ Specialization (guards = {"isNoValue(none)" }, limit = "1" )
@@ -204,18 +204,6 @@ Object dict(PythonModule self, @SuppressWarnings("unused") PNone none,
204
204
return dict ;
205
205
}
206
206
207
- @ Specialization (limit = "1" )
208
- Object dict (PythonModule self , PDict dict ,
209
- @ CachedLibrary ("self" ) PythonObjectLibrary lib ) {
210
- try {
211
- lib .setDict (self , dict );
212
- } catch (UnsupportedMessageException e ) {
213
- CompilerDirectives .transferToInterpreterAndInvalidate ();
214
- throw new IllegalStateException (e );
215
- }
216
- return PNone .NONE ;
217
- }
218
-
219
207
@ Specialization (guards = "isNoValue(none)" , limit = "1" )
220
208
Object dict (PythonAbstractNativeObject self , @ SuppressWarnings ("unused" ) PNone none ,
221
209
@ CachedLibrary ("self" ) PythonObjectLibrary lib ) {
@@ -226,11 +214,6 @@ Object dict(PythonAbstractNativeObject self, @SuppressWarnings("unused") PNone n
226
214
return dict ;
227
215
}
228
216
229
- @ Specialization (guards = {"!isNoValue(mapping)" , "!isDict(mapping)" })
230
- Object dict (@ SuppressWarnings ("unused" ) Object self , Object mapping ) {
231
- throw raise (TypeError , ErrorMessages .DICT_MUST_BE_SET_TO_DICT , mapping );
232
- }
233
-
234
217
@ Fallback
235
218
Object raise (Object self , @ SuppressWarnings ("unused" ) Object dict ) {
236
219
throw raise (PythonBuiltinClassType .TypeError , "descriptor '__dict__' for 'module' objects doesn't apply to a '%p' object" , self );
0 commit comments