classification
Title: strange list.sort() behavior on import, del and inport again
Type: Stage:
Components: Versions: Python 2.6
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: Nosy List: dstemmer
Priority: normal Keywords:

Created on 2009-05-01 04:50 by dstemmer, last changed 2009-05-01 06:28 by loewis. This issue is now closed.

Messages (2)
msg86861 - (view) Author: David Stemmer (dstemmer) Date: 2009-05-01 04:50
Given two modules, I've seen the following kind of strange behavior with
list sorting on import and delete; a list that has been imported, sorted
and deleted remains sorted on a second import:

my_module.py:

some_list = ['b','a']

other_module.py:

from  my_module import some_list
print some_list
some_list.sort()
print some_list
del some_list
from  my_module import some_list
print some_list

Output is:

['b','a']
['a','a']
['a','b']

Sorry if it's already been reported.
msg86863 - (view) Author: David Stemmer (dstemmer) Date: 2009-05-01 04:55
EDIT: delete this, duplicate post
History
Date User Action Args
2009-05-01 06:28:45loewissetstatus: open -> closed
resolution: duplicate
2009-05-01 04:55:59dstemmersetmessages: + msg86863
2009-05-01 04:53:40dstemmersetfiles: - bugs.rar
2009-05-01 04:50:58dstemmercreate