where '%s' is replaced with self.prog_name, an empty string and string "Available subcommands:". call the method collections.defaultdict with a argument: lambda function without arguments that returns an empty list,
commands_dict = collections . defaultdict ( lambda : [ ] )