namespace A class Foo pass namespace B class Foo pass namespace Main use A use B class P def main is shared Foo() # .error. Ambiguous reference "Foo" found in namespaces "A" and "B".