ninia / jep

Embed Python in Java
Other
1.32k stars 150 forks source link

Change Java fields and methods to type attributes instead of instance attributes #386

Closed bsteffensmeier closed 2 years ago

bsteffensmeier commented 2 years ago

The relationship between PyJObjects and their types now more closely resembles the behavior of normal Python types, allowing special methods such as add and repr to be picked up by Python when they are defined in Java classes.

Since all attributes of PyJObject have moved to the type the attr dict is no longer necessary. However, every instance of PyJClass still shares a type so it is not possible to move attributes of PyJClass to the type. Much of the code for dealing with instance attributes has moved from PyJObject to PyJClass.