namespace A namespace B class Foo pass class Bar pass namespace Main use A.B class P def main is shared Bar() # .error. Cannot find "Bar".