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".
Loading
Please register or sign in to comment