aibasel / machetli

GNU General Public License v3.0
6 stars 3 forks source link

PDDL visitor `contains` looks suspicious #63

Closed ClemensBuechner closed 1 week ago

FlorianPommerening commented 2 weeks ago

To clarify, here is the source code of the function:

def contains(dumpable_object, item_name) -> bool:
    """Returns true if item_name is present in dump string of dumpable_object."""
    str_io = io.StringIO()
    with redirect_stdout(str_io):
        dumpable_object.dump()
    return item_name in str_io.getvalue()

There are two code smells here:

FlorianPommerening commented 1 week ago

Fixed in #99 by rewriting the visitor