Inspirel banner

Programming Distributed Systems with YAMI4

3.4.5 Python

The yami package includes the Parameters class, which has the default constructor:

import yami;

# ...

params = yami.Parameters()
# ...

Alternatively, an empty dictionary object can be used to represent the same value:

params = {}

The only difference between these two approaches is in the fact that ordering of items and the resulting serialization sequences are guaranteed for the dedicated Parameters class, but not for the built-in dictionary type. This difference is irrelevant in the majority of use-cases.

It is relatively inexpensive to create empty parameters objects, so the recommended practice is to create them in the innermost scope where they are needed.