On Mar 7, 1:34 pm, [EMAIL PROTECTED] wrote: > On Mar 7, 6:44 am, Sion Arrowsmith <[EMAIL PROTECTED]> > wrote: > > > Gabriel Genellina <[EMAIL PROTECTED]> wrote: > > >En Thu, 06 Mar 2008 23:46:43 -0200, <[EMAIL PROTECTED]> escribi�: > > >> [ ... ] > > >You may look at the SimpleXMLRPCServer class and see how it implements > > >introspection. It's rather easy (and doesn't require metaclasses nor > > >decorators nor any other fancy stuff; I think it works the same since > > >Python 2.1). Apparently you're doing a similar thing, but using pickles > > >instead of xmlrpc. > > > It's not that difficult to graft pickles into SimpleXMLRPCServer -- > > I've done it, and if you're trying to sling large data structures > > over the connection it's a massive performance win (even with > > sgmlop in place to speed up XML parsing). > > her nu becomeþ se bera eadward ofdun hlæddre heafdes bæce bump bump bump > > Yeah, but I'd be grafting a non-blocking RPC sequence too. > > -Instantiate- attributes of ISS upon instantiation. > > class C: > d= D > > c= C() > assert isinstance( c.d, D ) > assert c.d is c.d > > Which ones?
Two options: instantiate all attributes, or ones with a certain property, such as name or superclass. class C: inst_d= D #actually gets bound to 'd', optionally class C: d= inst( D ) I think what I'm looking for is an attribute wrapper. class C: @inst d= D But the closest the syntax goes is: class C: class d( D ): pass (which takes us back to one of Steven's posts some days ago.) ( def f(x=None):/class C:/x= X/return C. ) and the d= inst( D ) solution.) You either need to assign something to assign something to its name, class C: d= X or declare it, but that only allows def and class statements (correct?). class C: attr d: D is ideal. -- http://mail.python.org/mailman/listinfo/python-list