python: improve bdd_dict bindings

Fixes #372.

* python/spot/impl.i: Refactor the handling of exceptions using a
Lippincott function.  Map out_of_range to IndexError.  Add
PyObject* version for bdd_dict's register and unregister functions
so we can use Python objects as well.
* tests/python/bdddict.py: New file.
* tests/Makefile.am: Add it.
* NEWS: Mention the changes.
This commit is contained in:
Alexandre Duret-Lutz 2019-01-14 16:42:30 +01:00
parent bd0f959418
commit 3908cc1bca
4 changed files with 216 additions and 7 deletions

15
NEWS
View file

@ -1,11 +1,26 @@
New in spot 2.7.0.dev (not yet release)
Python:
- The following methods of spot::bdd_dict are now usable in Python when
fine controle over the lifetime of associations between BDD variable
and atomic propositions is needed.
- register_proposition(formula, for_me)
- register_anonymous_variables(count, for_me)
- register_all_propositions_of(other, for_me)
- unregister_all_my_variables(for_me)
- unregister_variable(var, for_me)
Bugs fixed:
- The print_dot_psl() function would incorrectly number all but the
first children of commutative n-ary operators: in this case no
numbering was expected.
- std::out_of_range C++ exceptions raised from Python code are now
converted into IndexError Python exceptions (instead of aborting
the program).
New in spot 2.7 (2018-12-11)
Command-line tools: