Rewrite most of the core_foundation module based on Foundation #88
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.
Implements #74.
This is a rewrite of most of the
core_foundation
module's functions based on Foundation classes, resulting in more readable code with no manual function declarations needed. The only things left in thecore_foundation
module are the basic types/constants/functions used by theasync
eventloop
module.The conversion functions have also been restructured a bit.
from_value
andto_value
have been renamed tons_from_py
andpy_from_ns
, because the old names weren't very clear on what direction the conversion went. Theat
function, which previously only produced strings, is now exactly equivalent tons_from_py
. This allows things likeat(42)
orat([1, 2, 3])
, similar to the@
prefix/operator in Objective-C. The type-specific conversion functions (to_str
,to_number
, etc.) have been removed, becausepy_from_ns
can be used in place of all of them.I don't know if the old functions from
core_foundation
are used much externally. I did a quick search through the Toga repo and couldn't find anything exceptat
being used. (at
has only been moved internally, so that shouldn't be an issue.) Are there any other users of Rubicon that I should check for this sort of thing? I know Rubicon isn't officially stable yet, but I still prefer not to break other people's code.As usual, this PR includes some general cleanup and fixes, so the individual commit diffs may be easier to read than the full diff.