This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rosadenderon
Recipients rosadenderon
Date 2020-11-16.20:41:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1605559279.93.0.379115833949.issue42379@roundup.psfhosted.org>
In-reply-to
Content
Including script explicitly:


# -*- coding: utf-8 -*-

class Obj:
    def __init__(self, num):
        self.num = num
        self.var = self.funct()
        
    def funct(self, array = []):
        print (array)
        array = [1,2,3]
        return array
    
    
    
def main():
    obj1 = Obj(1)
    print (obj1.num, obj1.var) # prints: 1 [1, 2, 3]


    obj2 = Obj(2)
    
    print (obj1.num, obj1.var) # prints: 1 [1, 2, 3, 1, 2, 3]
    print (obj2.num, obj2.var) # prints: 2 [1, 2, 3, 1, 2, 3]
    
    
if __name__ == "__main__": 
    main()
History
Date User Action Args
2020-11-16 20:41:19rosadenderonsetrecipients: + rosadenderon
2020-11-16 20:41:19rosadenderonsetmessageid: <1605559279.93.0.379115833949.issue42379@roundup.psfhosted.org>
2020-11-16 20:41:19rosadenderonlinkissue42379 messages
2020-11-16 20:41:19rosadenderoncreate