In article <60848752-2c3f-4512-bf61-0bc11c919...@i20g2000prf.googlegroups.com>, Carl Banks <pavlovevide...@gmail.com> wrote: > >The problem comes when a different part of the upstream package also >subclasses or creates a Box. When an upstream function creates a box, >it creates an upstream.packaging.Box instead of a >mine.custom_packaging.Box, but I'd want it to do the latter.
The only clean way I'm aware of is to pass in an instance and use instance.__class__ to create new instances. Did you come up with another idea? -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "All problems in computer science can be solved by another level of indirection." --Butler Lampson -- http://mail.python.org/mailman/listinfo/python-list