On Mon, Oct 30, 2017 at 11:35 AM, Terry Brown <[email protected]> wrote:
Thanks for fixing, Edward - day jobs are so intrusive sometimes :-/ > You're welcome. I probably should have fixed this earlier myself. Studying the Jupyter sources has made me more aware of the complexity of imports and __init__.py files. I've created a sub-project for the study of same. (This will be pre-writing for it.) Furthermore, not everything works the same in Python 2 and 3, and there are even some new features in Python 3.6... My provisional conclusion about Leo is that explicit imports, based on the leo module, will always continue to work. The extra typing is worthwhile. Some early conclusions about Jupyter: 1. Jupyter imports apparently "work" in the sense that they don't prevent external programs from importing Jupyter packages and modules. There are no "gotcha" side effects, but see #3 below. 2. Having said that, __init__.py is mysterious. Prints statements don't work there, perhaps because logging has already been enabled. 3. pyflakes, my favorite tool, complains about several __init__.py, with corresponding warnings about undefined symbols in modules within the package. This is bad style: explicit is better than implicit. It's unfortunate that unmodified Jupyter files create such warnings. Some warning in __init__.py files arise from the "from x import *" anti-pattern. Furthermore, few/none of the imports are used in the __init__.py files themselves, which creates other warnings. None of this is necessary. It saves just a few lines of code in modules, at the expense of clarity and pyflakes warnings. Afaik, there are no performance gains by these anti-patterns. Edward -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
