Skip to content

Error message (8) #255

@HolQue

Description

@HolQue

With the last line of following code a new parameter name shall be created - based on a dictionary:

"keyParam" : "A",
"dictParam" : {"A" : 1},
"listParam" : ["A", "B"],
"${dictParam}" : 5

A dictionary cannot be used as name. Therefore I get the following error message:

Error: 'Found expression '${dictParam}' with at least one parameter of composite data type ('${dictParam}' is of type <class 'dict'>).
Because of this expression is the name of a parameter, only simple data types are allowed to be substituted inside.'!

This is correct.

Now I want to overwrite a key value of this dictionary. But by mistake I use the listParam instead of the keyParam.

${dictParam}[${listParam}] : 5

A list cannot be used as key name. Therefore also in this case an error message is expected. The error is:

Error: 'Found expression '${listParam}' with at least one parameter of composite data type ('${listParam}' is of type <class 'list'>).
Because of this expression is the name of a parameter, only simple data types are allowed to be substituted inside.'!

This is not completely wrong, but misleading. It's the same error message, but a complete different use case.

The error message belongs to a dollar operator expression, encapsulated in quotes, that would - if placed on the left hand side of the colon - create a new parameter name dynamically.

This error does not fit to the second code example. In second case I suggest to use the original error message from Python interpreter:

TypeError: unhashable type: 'list'

Or you provide an own interpretation, something like:

Dictionary keys are expected to be of type str or int.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions