In PyQGIS we can obtain the active (currently selected) layer with
>>> iface.activeLayer()
<QgsRasterLayer: '007' (gdal)>
With a group selected this returns None
(?).
QgsInterface
does not seem to have a method to obtain the active group, is there any workaround to find out the active group from PyQGIS?