Copy constructors

Aahz Maruch aahz at panix.com
Fri Aug 10 10:59:29 EDT 2001


In article <3B72DCBA.C99465BC at labs.agilent.com>,
David Smith  <drs at labs.agilent.com> wrote:
>
>It appears that the preferred way to make a copy constructor is to
>define the __copy__ method.  In the examples I have seen, __copy__ then
>creates a new object in the usual way, which invokes __init__.  In a
>class I have at hand, __init__ does some real work, which I want to
>bypass -- I want to clone the results of that work.  I don't want to
>redefine __init__'s parameter list (to permit passing only one parameter
>of the same class), because it would screw up IDLE's automatic parameter
>list prompting.

I don't understand that last sentence.  How does permitting only one
argument screw up IDLE?
-- 
                      --- Aahz  <*>  (Copyright 2001 by aahz at pobox.com)

Hugs and backrubs -- I break Rule 6                 http://www.rahul.net/aahz/
Androgynous poly kinky vanilla queer het Pythonista   

"i-write-best-when-the-audience-is-me-ly y'rs  - tim"



More information about the Python-list mailing list