On Mon, Dec 22, 2003 at 09:27:17AM -0600, Doug Quale wrote:
> Christian Robottom Reis <[EMAIL PROTECTED]> writes:
> 
> > On Sun, Dec 21, 2003 at 09:52:13AM -0800, Jeff Bowden wrote:
> > >    myModel = gtk.ListStore(object)
> > 
> > What's the deal with specifying the type here as "object" versus
> > Gustavo's recommended gobject.TYPE_PYOBJECT?
> 
> I would guess that it's just a matter of taste, like using
> gtk.ListStore(str) instead of gobject.TYPE_STRING.  It's easier to
> type and to read, and you don't have to import gobject unless you need
> gobject for something else.

I see now. The interesting bit here is that with python2.3, *everything*
is considered to be "an instance of" the object type -- even instances
of classes that don't inherit from object.

    >>> class Foo: pass
    ... 
    >>> isinstance(Foo(), object)
    True
    >>> isinstance(1, object)
    True
    >>> isinstance({}, object)
    True

I hadn't realized this initially, and I'm not sure it makes complete
sense to me, but it sure makes this API a lot simpler. I'm left
wondering now if you're allowed to specify `type' as a column type,
though.

Thanks for the answer,
--
Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 261 2331
_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to