@@ -144,7 +144,7 @@ public static PythonLikeType translatePythonClass(PythonCompiledClass pythonComp
144144 classWriter .visit (Opcodes .V11 , Modifier .PUBLIC , internalClassName , null ,
145145 superClassType .getJavaTypeInternalName (), interfaces );
146146
147- pythonCompiledClass .staticAttributeNameToObject .forEach (pythonLikeType ::__setAttribute );
147+ pythonCompiledClass .staticAttributeNameToObject .forEach (pythonLikeType ::$setAttribute );
148148
149149 classWriter .visitField (Modifier .PUBLIC | Modifier .STATIC , TYPE_FIELD_NAME , Type .getDescriptor (PythonLikeType .class ),
150150 null , null );
@@ -154,7 +154,7 @@ public static PythonLikeType translatePythonClass(PythonCompiledClass pythonComp
154154
155155 for (Map .Entry <String , PythonLikeObject > staticAttributeEntry : pythonCompiledClass .staticAttributeNameToObject
156156 .entrySet ()) {
157- pythonLikeType .__setAttribute (staticAttributeEntry .getKey (), staticAttributeEntry .getValue ());
157+ pythonLikeType .$setAttribute (staticAttributeEntry .getKey (), staticAttributeEntry .getValue ());
158158 }
159159
160160 Map <String , PythonLikeType > attributeNameToTypeMap = new HashMap <>();
@@ -259,17 +259,17 @@ public static PythonLikeType translatePythonClass(PythonCompiledClass pythonComp
259259 PythonBytecodeToJavaBytecodeTranslator .writeClassOutput (BuiltinTypes .classNameToBytecode , className ,
260260 classWriter .toByteArray ());
261261
262- pythonLikeType .__setAttribute ("__name__" , PythonString .valueOf (pythonCompiledClass .className ));
263- pythonLikeType .__setAttribute ("__qualname__" , PythonString .valueOf (pythonCompiledClass .qualifiedName ));
264- pythonLikeType .__setAttribute ("__module__" , PythonString .valueOf (pythonCompiledClass .module ));
262+ pythonLikeType .$setAttribute ("__name__" , PythonString .valueOf (pythonCompiledClass .className ));
263+ pythonLikeType .$setAttribute ("__qualname__" , PythonString .valueOf (pythonCompiledClass .qualifiedName ));
264+ pythonLikeType .$setAttribute ("__module__" , PythonString .valueOf (pythonCompiledClass .module ));
265265
266266 PythonLikeDict annotations = new PythonLikeDict ();
267267 pythonCompiledClass .typeAnnotations .forEach ((name , type ) -> annotations .put (PythonString .valueOf (name ), type ));
268- pythonLikeType .__setAttribute ("__annotations__" , annotations );
268+ pythonLikeType .$setAttribute ("__annotations__" , annotations );
269269
270270 PythonLikeTuple mro = new PythonLikeTuple ();
271271 mro .addAll (superTypeList );
272- pythonLikeType .__setAttribute ("__mro__" , mro );
272+ pythonLikeType .$setAttribute ("__mro__" , mro );
273273
274274 Class <? extends PythonLikeObject > generatedClass ;
275275 try {
@@ -339,7 +339,7 @@ public static void setSelfStaticInstances(PythonCompiledClass pythonCompiledClas
339339 objectInstance .$setCPythonId (PythonInteger .valueOf (pythonReferenceId .longValue ()));
340340 objectInstance .$setInstanceMap (instanceMap );
341341 objectInstance .$readFieldsFromCPythonReference ();
342- pythonLikeType .__setAttribute (attributeName , objectInstance );
342+ pythonLikeType .$setAttribute (attributeName , objectInstance );
343343 } catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException e ) {
344344 throw new RuntimeException ("Unable to construct instance of class (" + generatedClass + ")" , e );
345345 }
@@ -442,7 +442,7 @@ private static Class<?> createBytecodeForMethodAndSetOnClass(String className, P
442442
443443 generatedClass .getField (getJavaMethodName (methodEntry .getKey ()))
444444 .set (null , functionInstance );
445- pythonLikeType .__setAttribute (methodEntry .getKey (), translatedPythonMethodWrapper );
445+ pythonLikeType .$setAttribute (methodEntry .getKey (), translatedPythonMethodWrapper );
446446 return functionClass ;
447447 } catch (IllegalAccessException | NoSuchFieldException e ) {
448448 throw new IllegalStateException ("Impossible State: could not access method (" + methodEntry .getKey ()
@@ -508,7 +508,7 @@ private static Class<?> createPythonWrapperMethod(String methodName, PythonCompi
508508 Type .getDescriptor (PythonLikeType .class ));
509509 methodVisitor .visitLdcInsn (methodName );
510510 methodVisitor .visitMethodInsn (Opcodes .INVOKEINTERFACE , Type .getInternalName (PythonLikeObject .class ),
511- "__getAttributeOrError " ,
511+ "$getAttributeOrError " ,
512512 Type .getMethodDescriptor (Type .getType (PythonLikeObject .class ), Type .getType (String .class )),
513513 true );
514514 methodVisitor .visitTypeInsn (Opcodes .CHECKCAST , Type .getInternalName (PythonLikeFunction .class ));
@@ -805,7 +805,7 @@ public static Type getVirtualFunctionReturnType(PythonCompiledFunction function)
805805 public static void createGetAttribute (ClassWriter classWriter , String classInternalName , String superInternalName ,
806806 Collection <String > instanceAttributes ,
807807 Map <String , PythonLikeType > fieldToType ) {
808- MethodVisitor methodVisitor = classWriter .visitMethod (Modifier .PUBLIC , "__getAttributeOrNull " ,
808+ MethodVisitor methodVisitor = classWriter .visitMethod (Modifier .PUBLIC , "$getAttributeOrNull " ,
809809 Type .getMethodDescriptor (Type .getType (PythonLikeObject .class ),
810810 Type .getType (String .class )),
811811 null , null );
@@ -823,7 +823,7 @@ public static void createGetAttribute(ClassWriter classWriter, String classInter
823823 }, () -> {
824824 methodVisitor .visitVarInsn (Opcodes .ALOAD , 0 );
825825 methodVisitor .visitVarInsn (Opcodes .ALOAD , 1 );
826- methodVisitor .visitMethodInsn (Opcodes .INVOKESPECIAL , superInternalName , "__getAttributeOrNull " ,
826+ methodVisitor .visitMethodInsn (Opcodes .INVOKESPECIAL , superInternalName , "$getAttributeOrNull " ,
827827 Type .getMethodDescriptor (Type .getType (PythonLikeObject .class ),
828828 Type .getType (String .class )),
829829 false );
@@ -837,7 +837,7 @@ public static void createGetAttribute(ClassWriter classWriter, String classInter
837837 public static void createSetAttribute (ClassWriter classWriter , String classInternalName , String superInternalName ,
838838 Collection <String > instanceAttributes ,
839839 Map <String , PythonLikeType > fieldToType ) {
840- MethodVisitor methodVisitor = classWriter .visitMethod (Modifier .PUBLIC , "__setAttribute " ,
840+ MethodVisitor methodVisitor = classWriter .visitMethod (Modifier .PUBLIC , "$setAttribute " ,
841841 Type .getMethodDescriptor (Type .VOID_TYPE ,
842842 Type .getType (String .class ),
843843 Type .getType (PythonLikeObject .class )),
@@ -860,7 +860,7 @@ public static void createSetAttribute(ClassWriter classWriter, String classInter
860860 methodVisitor .visitVarInsn (Opcodes .ALOAD , 0 );
861861 methodVisitor .visitVarInsn (Opcodes .ALOAD , 1 );
862862 methodVisitor .visitVarInsn (Opcodes .ALOAD , 2 );
863- methodVisitor .visitMethodInsn (Opcodes .INVOKESPECIAL , superInternalName , "__setAttribute " ,
863+ methodVisitor .visitMethodInsn (Opcodes .INVOKESPECIAL , superInternalName , "$setAttribute " ,
864864 Type .getMethodDescriptor (Type .VOID_TYPE ,
865865 Type .getType (String .class ),
866866 Type .getType (PythonLikeObject .class )),
@@ -875,7 +875,7 @@ public static void createSetAttribute(ClassWriter classWriter, String classInter
875875 public static void createDeleteAttribute (ClassWriter classWriter , String classInternalName , String superInternalName ,
876876 Collection <String > instanceAttributes ,
877877 Map <String , PythonLikeType > fieldToType ) {
878- MethodVisitor methodVisitor = classWriter .visitMethod (Modifier .PUBLIC , "__deleteAttribute " ,
878+ MethodVisitor methodVisitor = classWriter .visitMethod (Modifier .PUBLIC , "$deleteAttribute " ,
879879 Type .getMethodDescriptor (Type .VOID_TYPE ,
880880 Type .getType (String .class )),
881881 null , null );
@@ -894,7 +894,7 @@ public static void createDeleteAttribute(ClassWriter classWriter, String classIn
894894 }, () -> {
895895 methodVisitor .visitVarInsn (Opcodes .ALOAD , 0 );
896896 methodVisitor .visitVarInsn (Opcodes .ALOAD , 1 );
897- methodVisitor .visitMethodInsn (Opcodes .INVOKESPECIAL , superInternalName , "__deleteAttribute " ,
897+ methodVisitor .visitMethodInsn (Opcodes .INVOKESPECIAL , superInternalName , "$deleteAttribute " ,
898898 Type .getMethodDescriptor (Type .VOID_TYPE ,
899899 Type .getType (String .class )),
900900 false );
0 commit comments