Greg Ewing wrote:
Cesare Di Mauro wrote:

The same happens with:

from Tkinter import *

which is a fair common instruction...

...and which should *not* be used in most cases, for
the same reason.

All those tutorials that start out with 'from something
import *' are doing a lot of harm to the impressionable
minds of new programmers, IMO.

Yeah, the only remotely legitimate usage of it that I am aware of is for modules with a hybrid implementation where the public Python module does a "from _native_module import *" to get the rest of the implementation. And even that is somewhat arguable.

To go back to Cesare's most recent example:

    t = ScrolledText.ScrolledText(master, width=60, height=37)
    t.insert(Tkinter.END, self.log.getText())
    t.configure(state=Tkinter.DISABLED)
    t.see(Tkinter.END)
    t.pack(fill=Tkinter.BOTH)

can look like:

  tk = Tkinter:
  st = ScrolledText.ScrolledText(master, width=60, height=37):
  st.insert(tk.END, self.log.getText())
  st.configure(state=tk.DISABLED)
  st.see(tk.END)
  st.pack(fill=tk.BOTH)

Cheers,
Nick.

--
Nick Coghlan   |   [EMAIL PROTECTED]   |   Brisbane, Australia
---------------------------------------------------------------
            http://www.boredomandlaziness.org
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to