I think either using "from gtk import *" or "import gtk" are useful (they
are just different styles of python programming).  I think I will leave
the Gtk prefix on the classes though, since it is used in all other GTK
language bindings I know of (perl, java, etc -- I know that the java
bindings decided on keeping the Gtk prefix even though all the classes
were in a gtk package).

Anyway, calling constructors is only one part of a large program, so it is
not as if it is that much overhead.

James Henstridge.

--
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/


On 20 Feb 1999, Hrvoje Niksic wrote:

> It's probably late to raise this topic, but I'd still like to hear
> opinions.  The thing is, `gtk.py' advocates `from gtk import *' as a
> good way to import the Gtk functionality and then uses the Gtk prefix
> to ensure namespace integrity.
> 
> However, I'm not sure it really buys us much.  I mean, importing stuff
> like GtkButton or GtkWindow to the global namespace is probably fine,
> given their common prefix, but I don't like getting stuff like
> atom_intern(), atom_name(), rc_parse(), idle_add(), events_pending(),
> new(), or, for that matter, TRUE and FALSE.
> 
> Wouldn't it be nicer if the normal usage of the gtk module were to
> just do `import gtk', and the Gtk prefix were removed from classes.
> Then you would write something like:
> 
>     import gtk
> 
>     class MyWindow (gtk.Window):      # instead of GtkWindow
>       ...
> 
>     window = MyWindow ()
>     window.show_all ()
>     ...
>     gtk.mainloop ()
> 
> James, what do you think about such a scheme?
> To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]
> 

To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]

Reply via email to