Repository navigation
Test: Round-trip numbers through state() now that the binder boxes them - #52
Merged
Merged
Conversation
python-multiplatform #69 (PR #81, develop 26485a02) boxes a Python scalar bound for a kotlin.Any slot by calling a PythonCallables box entry, and unboxes a handle read back out of one through unboxScalar. So state(0) and counter.value += 1 work; an int beyond 64 bits is refused with the reason. The test that pinned the old refusal is flipped, as its comment promised. The fake host gains the six entries in PythonCallables.kt's shape (boxInt, boxLong, boxDouble, boxBoolean, boxString: one primitive slot, the box's handle back as INT; unboxScalar: the handle in, the scalar or None out, releasing it), and a scalar held in a kotlin.Any now crosses back as a handle, as a Kotlin box would. Against a binder older than #69 the two scalar tests skip. runtime/__init__.py is unchanged: the boxing is the binder's. test changed: the refusal test becomes test_scalars_round_trip_through_a_kotlin_any (bool, int, float, str, and value += 1); test added: test_an_int_beyond_64_bits_is_refused_with_the_reason. Red against 26485a02 before the fake host change: 2 failed (no exposed declaration ...boxInt / ...boxString), then the old refusal test failed. documentation corrected: SPEC S5.4 and section 8, PROJECT.md, guide, README and README_ko; baselines. Suite with python-multiplatform 26485a02 (main checkout, notebook and zip): 223 passed; without a checkout, 125 passed, 98 skipped. check_guide.py: 0. Refs #51 Refs #11
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #51
python-multiplatform #69 boxes scalars for
Anyslots, sostate(0)andcount.value += 1work. The fake host now modelsPythonCallables' box and unbox entries in their real shape. The pinned refusal test flips to a round-trip test (bool, int, float, str), and an int beyond 64 bits stays refused with the reason. On binders older than #69 these tests skip.runtimecode is unchanged: the boxing is the binder's.Test changed or added: 2 tests. Documentation corrected: SPEC S5.4 and §8, PROJECT.md, guide, both READMEs.
Against 26485a02 (main checkout): 223 passed. No checkout: 125 passed, 98 skipped.