Method returning new instance of class?
Arthur
ajsiegel at optonline.com
Sat Sep 4 10:38:13 EDT 2004
"Paul Rubin" <http://phr.cx@NOSPAM.invalid> wrote in message
news:7xwtzaw8rz.fsf at ruckus.brouhaha.com...
> "Arthur" <ajsiegel at optonline.com> writes:
> > The way I am currently conceptualizing a solution, what I need is a
method
> > of the class that returns a new instance of the class.
>
> class foo:
> def bar(self):
> return foo()
>
> What's the problem?
As I responded to Martin, what I am looking for - though I didn't describe
it well - is a copy of the original instance (with, for example, same
version of attributes generated with reference to its original arguments).
And I am trying to work around something - or diagnose something I am
running into - using copy.deepcopy.
Is this the time to play with __dict__?
Art
More information about the Python-list
mailing list