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 m123orning
Recipients m123orning
Date 2014-01-06.03:37:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1388979444.45.0.0357103143169.issue20135@psf.upfronthosting.co.za>
In-reply-to
Content
I was using IDLE (Python GUI) for Python 3.3.3. I don't know if this is a bug or you guys intend it to be this way:

>>> x=[1,2]
>>> y=x
>>> y.append(3)
>>> x
[1, 2, 3]

personally i'd prefer x stays as [1,2] when i'm trying to mutate y

also:
>>> def f1(m,n=['haha']):
	if m==n:
		print('m==n')
	else:
		print('m!=n')
	n.append('yaya')
	
>>> f1(['haha'])
m==n
>>> f1(['haha'])
m!=n

I'd prefer getting consistent results when calling functions like f1
History
Date User Action Args
2014-01-06 03:37:24m123orningsetrecipients: + m123orning
2014-01-06 03:37:24m123orningsetmessageid: <1388979444.45.0.0357103143169.issue20135@psf.upfronthosting.co.za>
2014-01-06 03:37:24m123orninglinkissue20135 messages
2014-01-06 03:37:24m123orningcreate