Skip to content
Commit 3d24958b authored by Matt Wala's avatar Matt Wala
Browse files

Fix an issue where copying instances of _ODERightHandSide is broken.

In a nutshell, the problem arises because of the following:

>>> class A: pass
...
>>> class B(A): pass
...
>>> A.fields = ['x']
>>> print(B.fields)
['x']

pytools uses the class attribute "fields" to store the fields of the
record object. If no "fields" attribute is found, it creates one based
on the constructor arguments.

The "Function" class can have an "arg_names" argument in the
constructor, but the "_ODERightHandside(Function)" class can't accept
this this. If an instance of "Function" is created before an instance of
"_ODERightHandSide", then "_ODERightHandSide.fields" will contain
"arg_names". This is a problem, because "_ODERightHandSide.fields" will
be used as argument names to the constructor during a copy.

The fix is to exclude "arg_names" from the list of fields in
"_ODERightHandSide".
parent 0f98e7b5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment