Same Object !

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • diegososa
    New Member
    • Oct 2007
    • 19

    Same Object !

    This should be so easy, but i'm stuck... i want to have two local copies of an incoming object (in this case, a ConfigParser), to modify one of them and later compare them. The problem is that this code give me two names to the SAME object!!!

    [code=Python]class updater():
    def __init__(self, config):
    self.__config = config
    self.__oldconf = config [/code]

    How can i have an independent copy of the object?
    :oops:
  • bgeddy
    New Member
    • Aug 2007
    • 16

    #2
    Have a look at the copy module
    Code:
    import copy
    help(copy)
    print copy.__doc__

    Comment

    Working...