potassco / clingo

🤔 A grounder and solver for logic programs.
https://potassco.org/clingo
MIT License
599 stars 79 forks source link

TypeError: unsupported operand type(s) for +: 'ASTSequence' and 'ASTSequence' #450

Closed MaxOstrowski closed 11 months ago

MaxOstrowski commented 11 months ago

TypeError: unsupported operand type(s) for +: 'ASTSequence' and 'ASTSequence'

According to https://www.oreilly.com/library/view/python-in-a/0596001886/ch04s06.html sequences should have a + operator ? I have no clue though ...

rkaminsk commented 11 months ago

The ASTSequence implements collections.abc.MutableSequence. So it should provide a += operator but does not have to provide a + operator. It is also not really possible to provide one because ASTSequences are tied to ASTs. Simply use lists to store sequences of ASTs.

https://docs.python.org/3/library/collections.abc.html#collections-abstract-base-classes