since rhasspy uses python 3.6 this uses f-strings when possible. Not for logging since % only has to be evaluated when the log is actually used (I was not sure which logging things are always printed since for them f-strings would make sense in terms of readability + speed aswell)
in python e.g. a empty list evaluate to false -> checks using len() > 0 and len() == 0 can be done implicit, so I replaced them -> improves readability and is faster
converted if not x in y to if x not in y, since it is more readable
when iterating over a dict python iterates over the keys by default so it is not required to use e.g. for x in y.keys(), this removes .keys() whenever it is not required -> improves readability and is faster
if not x in y
toif x not in y
, since it is more readablefor x in y.keys()
, this removes .keys() whenever it is not required -> improves readability and is faster