Mailing List Archive

Universal Wrapper (was: Python T-Shirt <joke>)
Has anyone ever tried to write a class UninversalWrapper, which wraps another
object of *any* type and tries to emulate its behaviour?
I see no actual use for this, however, apart from satisfying a vague feeling of
clearing the language's boundaries.

Stefan
Universal Wrapper (was: Python T-Shirt <joke>) [ In reply to ]
Stefan Franke wrote:
>
> Has anyone ever tried to write a class UninversalWrapper, which wraps another
> object of *any* type and tries to emulate its behaviour?
> I see no actual use for this, however, apart from satisfying a vague feeling of
> clearing the language's boundaries.

These thingies do have some use... to hide data from other objects
(or individuals). Have a look at:

http://starship.skyport.net/~lemburg/mxProxy.html

Hmm, sure how to subclass an InstanceProxy in XXL though ;-)

--
Marc-Andre Lemburg
______________________________________________________________________
Y2000: Y2000: 234 days left
Business: http://www.lemburg.com/
Python Pages: http://starship.python.net/crew/lemburg/
Universal Wrapper (was: Python T-Shirt <joke>) [ In reply to ]
Stefan Franke (spamfranke@bigfoot.de) wrote:
: Has anyone ever tried to write a class UninversalWrapper, which wraps another
: object of *any* type and tries to emulate its behaviour?

There's something that might be what you have in mind, called the
struct module. For documentation, see
http://www.python.org/doc/lib/module-struct.html
--
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Will Ware email: wware[at]world[dot]std[dot]com
PGP fp (new key 07/15/97) 67683AE2 173FE781 A0D99636 0EAE6117