python: implement twa_graph.__copy__

Fixes #470, suggested by Cambridge Yang.

* python/spot/__init__.py (twa_graph.__copy__): Call make_twa_graph.
* tests/python/twagraph.py: Test it.
* NEWS: Mention it.
This commit is contained in:
Alexandre Duret-Lutz 2021-07-08 09:33:57 +02:00
parent 0509263f82
commit 0cf2d285b6
3 changed files with 16 additions and 3 deletions

5
NEWS
View file

@ -235,7 +235,10 @@ New in spot 2.9.7.dev (not yet released)
See https://spot.lrde.epita.fr/ipynb/games.html for examples.
- spot::twa::prop_set was previously abstent from the Python
binding. It is now available as spot.twa_prop_set (issue #453).
bindings, making it impossible to call make_twa_graph() for copying
a twa. It is now available as spot.twa_prop_set (issue #453).
Also for convenience, the twa_graph.__copy__() method, called by
copy.copy(), will duplicate a twa_graph (issue #470).
Bugs fixed: