Skip to content

variable descriptor exposed as class attribute after the first class instantiation. #2000

@jjotero

Description

@jjotero

Reproducer:

class Foo(rfm.RegressionTest):
    v = variable(int, value=1)

print(Foo.v) # Prints 1
Foo()
print(Foo.v) # Prints the variable descriptor object
Foo.v = 2
print(Foo.v) # Still prints the variable descriptor object

Even though this was tested for in the unit tests, the behaviour should be consistent regardless of the number of class instantiations.
In short, the variable descriptor should never be exposed like this and the variable's default value should be returned instead.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions