How about extending the input signature of Graph.is_connected() to include an option
empty_graph_is_connected = False ? (It could, of course, default to True instead, but I'm an enumeration guy and think this is nonsense.) Advantages, as I see them: * True-ists and False-ists both get their way. * Novice users of Graph.is_connected() are forced to confront the problem by the semantics of the method itself. * Can be configured to not break existing code (although this requires using the obviously wrong True). * Reflects the essentially definitional/philosophical nature of the problem. Disadvantages, as I see them: * Complicates the semantics of the method. * Adds a bit of logic. * Fails to end the philosophical debate—we'd still need to decide what to set to default! --Andrew
signature.asc
Description: OpenPGP digital signature