More about this: In there is

        elements = D.topological_sort()
    except Exception:
        raise ValueError("Hasse diagram contains cycles.")

and that should be "except TypeError", as that is what .topological_sort() raises from DiGraph that is not acyclic.

But should a function without parameters like ever raise TypeError? If we can run that, then the object foo is of the right type and has bar()-function. Or where goes the limit between TypeError and ValueError, i.e. what we mean by 'type' -- is DAG a "type" or just a DiGraph with some special properties?

Jori Mäntysalo

Reply via email to