[PR #6602/59db302d backport][stable-7] VarDict module utils: add as_dict() method (#6610)

VarDict module utils: add `as_dict()` method (#6602)

* VarDict module utils: add `as_dict()` method

* add changelog frag

(cherry picked from commit 59db302deb)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2023-05-31 08:32:10 +02:00 committed by GitHub
commit 7ee0389c98
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 0 deletions

View file

@ -173,3 +173,6 @@ class VarDict(object):
@property
def has_changed(self):
return any(True for var in self.__vars__.values() if var.has_changed)
def as_dict(self):
return dict((name, var.value) for name, var in self.__vars__.items())