Finally I found the answer : using the QgsLegendModelV2()class, and its functions inherited from QgsLayerTreeModel : "index(i,j)" to select each legend item and "rowcount" to obtain the rows number. All in a "for x in xrange" loop.
That gives:
for i in self.composition.items():
if isinstance(i,QgsComposerLegend):
legend = i
for i in xrange(legend.modelV2().rowCount()):
posteleg=legend.modelV2().index(i, 0)
print posteleg.data()
Best Answer
You can just go to Legend items and right-click the subgroup that you want to hide and click on Hidden. This will do what you are asking for.