Assign operator should not return reference to python

Bug #898549 reported by Martin Sandve Alnæs
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
DOLFIN
Won't Fix
Low
Johan Hake

Bug Description

a.operator=(b) for functions is mapped to python a.assign(b), and this returns a reference (to a/this). This reference is not properly wrapped in python, but I think it should rather be ignored than returned anyway.

from dolfin import *
c = Constant(0)
d = c.assign(Constant(1))

print d.__class__.mro()
"""
[<class 'dolfin.cpp.Constant'>,
 <class 'dolfin.cpp.Expression'>,
 <class 'dolfin.cpp.GenericFunction'>,
 <class 'ufc.ufc.function'>,
 <class 'dolfin.cpp.Variable'>,
 <type 'object'>]
"""

print c.__class__.mro()
"""
[<class 'dolfin.functions.constant.Constant'>,
 <class 'ufl.coefficient.Coefficient'>,
 <class 'ufl.terminal.FormArgument'>,
 <class 'ufl.terminal.Terminal'>,
 <class 'ufl.expr.Expr'>,
 <class 'ufl.common.Counted'>,
 <class 'dolfin.cpp.Constant'>,
 <class 'dolfin.cpp.Expression'>,
 <class 'dolfin.cpp.GenericFunction'>,
 <class 'ufc.ufc.function'>,
 <class 'dolfin.cpp.Variable'>,
 <type 'object'>]
"""

Changed in dolfin:
importance: Undecided → Low
milestone: none → trunk
Johan Hake (johan-hake)
Changed in dolfin:
assignee: nobody → Johan Hake (johan-hake)
status: New → Confirmed
Johan Hake (johan-hake)
Changed in dolfin:
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.