I found what I think is peculiar behaviour by python 3.4. I made these small files to illustrate the problem I am facing.
To focus on the problem, I now have a python pr
The problem you're running into is that when peculiar.py
is run as a script, it is not considered to be the peculiar
module. It is considered to be the __main__
module. Importing peculiar
will run the file again, producing a separate copy of the Point
class, the points_list
list, and so on.
I recommend separating your program's main
functionality into a separate file that imports peculiar
and calls the versions of everything from the peculiar
module. Alternatively, you can use import peculiar; peculiar.main()
in your if __name__ == "__main__"
block.