From ed5cccba8a45e4b82ff77a7c04abd982177ddff9 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Sat, 18 Apr 2020 00:30:25 +0200 Subject: [PATCH] python: fix to_parity default option handling * python/spot/__init__.py (to_options): Do not have options explicitely default to to_parity_options(), because that would be instantiated only once. --- python/spot/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python/spot/__init__.py b/python/spot/__init__.py index 9c3c92f67..0be5d0ac5 100644 --- a/python/spot/__init__.py +++ b/python/spot/__init__.py @@ -1292,7 +1292,7 @@ class scc_and_mark_filter: self.restore_acceptance() -def to_parity(aut, options = to_parity_options(), **kwargs): +def to_parity(aut, options = None, **kwargs): """Convert aut into a parity acceptance. This procedure combines multiple strategies to attempt to @@ -1306,6 +1306,10 @@ def to_parity(aut, options = to_parity_options(), **kwargs): Note that if you pass both your own options object and kwargs, options will be updated in place. """ + if options is None: + # Can't make this a default option, otherwise the default + # instance would be updated by the kwargs. + options = to_parity_options() if kwargs: for key,val in to_parity_options.__dict__.items(): if not key.startswith('_') and key != "thisown" and key in kwargs: