[New-bugs-announce] [issue5891] strange list.sort() behavior on import, del and inport again

David Stemmer report at bugs.python.org
Fri May 1 06:51:03 CEST 2009


New submission from David Stemmer <dstemmer at brandeis.edu>:

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.

----------
files: bugs.rar
messages: 86861
nosy: dstemmer
severity: normal
status: open
title: strange list.sort() behavior on import, del and inport again
versions: Python 2.6
Added file: http://bugs.python.org/file13825/bugs.rar

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5891>
_______________________________________


More information about the New-bugs-announce mailing list