I have a simple python dict why is a generator reference printed instead of the dict -
a simple dict created:
procinfos = {"f1": f1, "f2": f2, "f3shell" : (wrap_for_process, q, f3shell, "input arg1", "input arg2")}
then want print contents:
print (procinfo procinfo in procinfos) <generator object <genexpr> @ 0x7f46dccc0dc0>
why python tell me generator? how can print contents. have read generators, intended not consume dict/list. concretized collection - makes no sense (to me @ least..) not print it. v common use case, appreciate succint way basic print of these collections. thanks.
update: want in single line / inline, not multi lines. thanks.
just use brackets instead:
print [procinfo procinfo in procinfos]
Comments
Post a Comment