python: add __repr__ for rs_pair
* spot/twa/acc.hh: Hide default constructors, so that we can have keyword arguments on the main constructor. * python/spot/impl.i: Add __repr__. * tests/python/setacc.py: Test it.
This commit is contained in:
parent
5bb9c87d4c
commit
c3b7a691e4
3 changed files with 29 additions and 5 deletions
|
|
@ -670,6 +670,29 @@ def state_is_accepting(self, src) -> "bool":
|
|||
%include <spot/taalgos/minimize.hh>
|
||||
|
||||
|
||||
%extend spot::acc_cond::rs_pair {
|
||||
std::string __repr__()
|
||||
{
|
||||
std::ostringstream os;
|
||||
os << "spot.rs_pair(fin=[";
|
||||
char* sep = "";
|
||||
for (unsigned s: self->fin.sets())
|
||||
{
|
||||
os << sep << s;
|
||||
sep = ", ";
|
||||
}
|
||||
os << "], inf=[";
|
||||
sep = "";
|
||||
for (unsigned s: self->inf.sets())
|
||||
{
|
||||
os << sep << s;
|
||||
sep = ", ";
|
||||
}
|
||||
os << "])";
|
||||
return os.str();
|
||||
}
|
||||
}
|
||||
|
||||
%extend spot::trival {
|
||||
std::string __repr__()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue