SNEWS2 / snewpy

A Python package for working with supernova neutrinos
https://snewpy.readthedocs.io
BSD 3-Clause "New" or "Revised" License
26 stars 19 forks source link

Possibly typo/missing import #305

Closed KaraMelih closed 5 months ago

KaraMelih commented 7 months ago

https://github.com/SNEWS2/snewpy/blob/f897dd99b4b7abe133cf1e4f13a49a742be0e4f0/python/snewpy/__init__.py#L59

Just noticed it, while playing around. The exit() is not defined. Also in https://github.com/SNEWS2/snewpy/blob/f897dd99b4b7abe133cf1e4f13a49a742be0e4f0/python/snewpy/__init__.py#L72

I guess it was meant to be

from sys import exit
...
exit()
JostMigenda commented 7 months ago

Hmm… exit() should be defined without an explicit import from sys.

Though given that the documentation recommends using it only in the interactive interpreter, maybe the explicit import you suggest is preferable? I've never seen this make a practical difference; but if you do, we can go ahead and change this. Do you want to make a PR?