@@ -699,8 +699,8 @@ InstallMethod(PrintString, "for a digraph", [IsDigraph], String);
699699InstallMethod(String, " for a digraph" ,
700700[ IsDigraph] ,
701701function (D )
702- local n, N, i, mut, streps, outnbs_rep, lengths, strings, creators_streps,
703- creators_props, props;
702+ local n, N, i, mut, streps, outnbs_rep, lengths, strings,
703+ out_neighbours_string, creators_streps, creators_props, props;
704704 if IsMutableDigraph(D) then
705705 mut := " IsMutableDigraph, " ;
706706 else
@@ -722,7 +722,11 @@ function(D)
722722 ReplacedString(streps[ n] , " \\ " , " \\\\ " ), " \" " , " )" ));
723723 od ;
724724
725- outnbs_rep := Concatenation(" Digraph(" , mut, String(OutNeighbours(D)), " )" );
725+ out_neighbours_string := String(OutNeighbours(D));
726+ # print empty lists with two spaces for consistency
727+ # see https://github.com/gap-system/gap/pull/5418
728+ out_neighbours_string := ReplacedString(out_neighbours_string, " [ ]" , " [ ]" );
729+ outnbs_rep := Concatenation(" Digraph(" , mut, out_neighbours_string, " )" );
726730 Add(strings, String(outnbs_rep));
727731
728732 N := DigraphNrVertices(D);
0 commit comments