Skip to content

DBHandler::config_db inconsistent zip list order #48

@diegonc

Description

@diegonc

In the DBHandler class there is the config_db method

def config_db(stack_config):

which in full reads:

@staticmethod
def config_db(stack_config):
    db = {}
    for number, gv_name in zip([stack_config.dbConfig.sizes.numBinary,
                                stack_config.dbConfig.sizes.numBinaryOutputStatus,
                                stack_config.dbConfig.sizes.numAnalog,
                                stack_config.dbConfig.sizes.numAnalogOutputStatus],
                                ["Analog", "AnalogOutputStatus",
                                 "Binary", "BinaryOutputStatus"]):
         val_body = dict((n, None) for n in range(number))
         db[gv_name] = val_body

    return db

I wonder how this actually works given that the order of the first list in the zip call does not seem to be the same as the one of the second list.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions