Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

Conversation

bsteffensmeier
Copy link
Member

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.

… attributes.

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.
src/main/c/Jep/pyembed.c Show resolved Hide resolved
src/main/c/Objects/pyjclass.c Show resolved Hide resolved
src/main/c/Objects/pyjclass.c Show resolved Hide resolved
src/main/c/Objects/pyjclass.c Show resolved Hide resolved
src/main/c/Objects/pyjtype.c Outdated Show resolved Hide resolved
src/main/c/Objects/pyjclass.c Outdated Show resolved Hide resolved
@bsteffensmeier bsteffensmeier merged commit c5d55fb into ninia:dev_4.1 Apr 22, 2022
@bsteffensmeier bsteffensmeier deleted the pyjobject-type-attributes branch May 4, 2022 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants