more flexibility in getDomainSizes() for Jython

...allow getDomainSizes(Data) to return lengths of more than just GriddedSets