[python][generator] Consider holder type See merge request core/dune-common!973
mentioned in commit fb179f94
mentioned in commit b2525d14