Skip to content

maintaining bidirectional transformation equality when automatically converting (semantically) immutable data #193

Closed
@thautwarm

Description

@thautwarm
from julia import Main as jl
jl.seval("1 => 2") #  python tuple (1, 2)
f = jl.seval(r"""
function (p::Pair{Int, Int})
    p.first
end """)

f(jl.seval("1 => 2"))
# TypeError: Julia: MethodError: no method matching (::var"#1#2")(::Tuple{Int64, Int64})
# Closest candidates are:
#  (::var"#1#2")(!Matched::Pair{Int64, Int64}) at none:2

Automatic conversion is handy, but we could avoid possible issues if we hold to_julia(to_python(o)) === o in Julia or to_python(to_julia(o)) == o in Python.

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleIssues about to be auto-closed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions