Namespaces: memory vs 'pollution'

Ethan Furman ethan at stoneleaf.us
Mon Jul 22 19:00:36 EDT 2019


On 07/20/2019 05:02 PM, DL Neil wrote:

> Upon closer inspection, I realised it didn't just fail; it failed badly! Some silly, little, boy had imported the PythonEnvironment class but failed to ALSO import PythonVersionError. So, the reported error was not the expected exception!

I don't understand the significance of not importing PythonVersionError:

- PythonEnvironment does not need it to be imported

- when PythonEnvironment raises PythonVersionError you still get PythonVersionError

- if your code says `except PythonVersionError` and you haven't imported it you'll get a NameError

So, what's the issue?

--
~Ethan~



More information about the Python-list mailing list