-
Notifications
You must be signed in to change notification settings - Fork 18
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
Function for converting Python values to an explicit Java type #128
Merged
devinrsmith
merged 30 commits into
jpy-consortium:master
from
rbasralian:raffi_obj_conv
Jan 24, 2024
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
9bdbaeb
Add method to convert Python value to a Java object of the specified …
rbasralian 06df869
make some return values more clear/meaningful
rbasralian d599bf0
update some tests to match current behavior
rbasralian 1676e46
Fix bug when casting using a type name (not a JPy_JType). Add method …
rbasralian d43e8df
Make as_jobj actually work. Clarify variable names in cast_internal a…
rbasralian 20444d6
Update .gitignore
rbasralian 5a3fdf0
Remove a stray print()
rbasralian ea60b1f
dev version bump
rbasralian 61bde34
update types in test
rbasralian 877a99b
comments on failing test
rbasralian 36ed7a0
more logging for tests
rbasralian b49090b
Merge remote-tracking branch 'origin/master' into raffi_obj_conv
rbasralian 3dea91c
Merge remote-tracking branch 'origin/master' into raffi_obj_conv
rbasralian 0996fac
Fix potential memory leak
rbasralian 2794f6b
Replace get_type_name() with `.jclassname` attribute
rbasralian e20757b
Clean up redundant conditions/extra parentheses
rbasralian 525362d
more tests
rbasralian 2d252c3
Replace deprecated assertion
rbasralian c25ab7c
formatting
rbasralian eaff9d6
Tests for converting to primitive and boxed arrays
rbasralian dc161cf
Update test for explicitly converting to PyObject. Add more details o…
rbasralian d204645
Update deprecated assertion
rbasralian 1d884a8
fix broken test
rbasralian c61869d
add a macro for building Python Nones (separate from`FROM_JVOID` and …
rbasralian 010feaf
comment out nonfunctional test
rbasralian b060d17
update test to support newer JVMs
rbasralian bdd1f72
Move convert-to-PyObject test to another file (and run it with a clas…
rbasralian efab329
consistent capitalization in print()s
rbasralian 4182956
Fix incorrect returns of `Py_NONE`
rbasralian f364d46
Rename `as_jobj` to `convert`
rbasralian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,4 @@ Vagrantfile | |
*.so | ||
*.dll | ||
|
||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you comment on the effect of this? It looks like you removed the JPy_JObject condition from Long / Float, but not Double?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the cases I changed were:
and:
in both case, the second
type == JPy_JObject
test will always be false — for the first case, we will have already landed inJType_CreateJavaNumberFromPythonInt
and in the second case we'd hitJType_CreateJavaDoubleObject
.