[issue42379] Optional List Args Persist Across Objects

2020-11-16 Thread Rose Ridder
Rose Ridder added the comment: Sorry, incorrect code pasted in. The full comment and code is below: When creating several objects in one program, if there are lists passed into functions as optional arguments, those lists are persistent across all objects. # -*- coding: utf-8 -*- class Obj

[issue42379] Optional List Args Persist Across Objects

2020-11-16 Thread Rose Ridder
Rose Ridder added the comment: 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

[issue42379] Optional List Args Persist Across Objects

2020-11-16 Thread Rose Ridder
New submission from Rose Ridder : When creating several objects in one program, if there are lists passed into functions as optional arguments, those lists are persistent across all objects. -- components: ctypes files: PythonObjectListIssue.py messages: 381153 nosy: rosadenderon