I guess they wanted to raise an exception if the graph has cycles, while at the same time still be able to use the object partially. Then the constructor can not raise.
Also, you don't have to call is_active(), the object itself is convertible to bool. Not sure if that is an improvement.
graphlib is definitely underwhelming at the moment. A standard Python vocabulary for graphs would be nice.
Also, you don't have to call is_active(), the object itself is convertible to bool. Not sure if that is an improvement.
graphlib is definitely underwhelming at the moment. A standard Python vocabulary for graphs would be nice.