[python] prevent name clashes when importing nested classes