[ python-Bugs-1152726 ] Default class args get clobbered by prior instances.

SourceForge.net noreply at sourceforge.net
Sun Feb 27 04:16:33 CET 2005


Bugs item #1152726, was opened at 2005-02-26 22:10
Message generated for change (Settings changed) made by sdrabble
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1152726&group_id=5470

Category: Python Interpreter Core
Group: Python 2.3
Status: Open
Resolution: None
>Priority: 8
Submitted By: Simon Drabble (sdrabble)
Assigned to: Nobody/Anonymous (nobody)
Summary: Default class args get clobbered by prior instances.

Initial Comment:
OS: SuSE Linux 9.2  kernel 2.6.4
Python: 2.3.3

Define a class where the __init__() method takes a default arg of list 
type. Instantiate this class, and append/ extend the value of its default 
arg. Instantiate the class again, and the value from the first instance 
will overwrite the second. 

The bug is known to exist in 2.3.3, but may exist in subsequent 
releases also. 

The attached file illuminates the problem.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1152726&group_id=5470


More information about the Python-bugs-list mailing list