Skip to content

parent of argument lost with Functions #20312

Closed
@rwst

Description

@rwst

Some Python objects as function arguments lose their parent, i.e. the code in the specific function can no longer access it because the object was coerced into SR. This can result in violation of the rule that function input and output should be of the same type.

sage: S.<y> = PolynomialRing(RR)
sage: ex = sin(asin(y)); ex
y
sage: type(ex)
<type 'sage.symbolic.expression.Expression'>
sage: ex.is_symbol()
True

The specific function (here sin) code cannot remedy this because there the damage is already done. The problem is in symbolic/function.pyx:BuiltinFunction.__call__ where the parent of function arguments is lost.

See also #18832 and maybe #17790.

CC: @jdemeyer

Component: symbolics

Author: Ralf Stephan

Branch/Commit: 58f3d00

Reviewer: Volker Braun

Issue created by migration from https://trac.sagemath.org/ticket/20312

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions