-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Original reporter: rayosborn
There is a function called 'open' in napi.py, which is included in the 'all' list. That means that doing 'from nxs import *' prevents use of the standard Python open function. Of course, wildcard imports are frowned because of just this issue but, for interactive use of the tree API, they are highly desirable, and not likely to cause problems. It would be good if people are not forced to type 'nxs.NXentry' etc. and 'open' and perhaps 'load' in tree.py, are the only problems.
There are a couple of possible solutions. One is to rename 'open' to 'nxopen', or make 'nxopen = open' and add only nxopen to the all list. The other is to put 'import napi as nx' in the package init.py so that 'from nxs import *', will still require calling 'nx.open'. The latter, however, would require people to type 'nxs.nx.open' if they just did 'import nxs'.
Comments on this are welcome.