Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

strange list.sort() behavior on import, del and inport again #50141

Closed
dstemmer mannequin opened this issue May 1, 2009 · 2 comments
Closed

strange list.sort() behavior on import, del and inport again #50141

dstemmer mannequin opened this issue May 1, 2009 · 2 comments

Comments

@dstemmer
Copy link
Mannequin

dstemmer mannequin commented May 1, 2009

BPO 5891

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2009-05-01.06:28:45.686>
created_at = <Date 2009-05-01.04:50:56.497>
labels = []
title = 'strange list.sort() behavior on import, del and inport again'
updated_at = <Date 2009-05-01.06:28:45.674>
user = 'https://bugs.python.org/dstemmer'

bugs.python.org fields:

activity = <Date 2009-05-01.06:28:45.674>
actor = 'loewis'
assignee = 'none'
closed = True
closed_date = <Date 2009-05-01.06:28:45.686>
closer = 'loewis'
components = []
creation = <Date 2009-05-01.04:50:56.497>
creator = 'dstemmer'
dependencies = []
files = []
hgrepos = []
issue_num = 5891
keywords = []
message_count = 2.0
messages = ['86861', '86863']
nosy_count = 1.0
nosy_names = ['dstemmer']
pr_nums = []
priority = 'normal'
resolution = 'duplicate'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue5891'
versions = ['Python 2.6']

@dstemmer
Copy link
Mannequin Author

dstemmer mannequin commented May 1, 2009

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.

@dstemmer
Copy link
Mannequin Author

dstemmer mannequin commented May 1, 2009

EDIT: delete this, duplicate post

@loewis loewis mannequin closed this as completed May 1, 2009
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants