<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Dec 10, 2019 at 10:35 AM Piergiorgio Pancino <<a href="mailto:piergiorgio.pancino@gmail.com">piergiorgio.pancino@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Una alternativa sarebbe impedire l'import star, la domanda infatti verte su questo: e' possobile sollevare un'eccezione su questo tipo di import?</div></blockquote><div>Definisci <span style="font-family:monospace">__all__</span> <br><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace"></span></div><div><span style="font-family:monospace">raf@howl € cat lib1.py </span></div><div><span style="font-family:monospace"></span></div><span style="font-family:monospace">__all__ = []<br><br>def func():<br>    print('lib1')<br>Premi un tasto per continuare...<br><br>raf@howl € cat lib2.py <br>__all__ = []<br><br>def func():<br>    print('lib2')<br>Premi un tasto per continuare...<br><br>raf@howl € cat main.py <br>from lib1 import *<br>from lib2 import *<br><br></span><div><span style="font-family:monospace">func()</span></div><div><span style="font-family:monospace">raf@howl € python3 main.py <br>Traceback (most recent call last):<br>  File "main.py", line 4, in <module><br>    func()<br>NameError: name 'func' is not defined</span></div></div></div><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>| Raffaele Salmaso<br>| <a href="https://salmaso.org" target="_blank">https://salmaso.org</a><br>| <a href="https://bitbucket.org/rsalmaso" target="_blank">https://bitbucket.org/rsalmaso</a><br>| <a href="https://github.com/rsalmaso" target="_blank">https://github.com/rsalmaso</a><br></div></div></div></div></div></div></div></div>