[issue40081] List sorting

2020-03-27 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
components:  -IDLE

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40081] List sorting

2020-03-27 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
assignee: terry.reedy -> 

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40081] List sorting

2020-03-26 Thread Eric V. Smith


Eric V. Smith  added the comment:

In the future, please use the python-tutor or python-list mailing lists if you 
need help. If you still think you've found a bug in python, then open an issue 
here.

https://mail.python.org/mailman/listinfo/tutor
https://mail.python.org/mailman/listinfo/python-list

--
nosy: +eric.smith
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type: resource usage -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40081] List sorting

2020-03-26 Thread 朱聖黎

朱聖黎  added the comment:

I think it's an expected behavior.

`a.sort()` sorts the list itself in place, so it returns None.

If you want a sorted list returned, you need to use `sorted` function.

https://docs.python.org/3/library/functions.html#sorted

--
nosy: +akarei

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40081] List sorting

2020-03-26 Thread Sivasundar Nagarajan


New submission from Sivasundar Nagarajan :

Good day. Hope you are safe and wish the same with the present situation.
Need you help please in understanding the below function of Python. 
 
 
Steps - 
1. tried assigning the below values in the list and named it as a
2.if I print, it prints in the same sequence.
3.Tried assigning it to b by the command a.sort()
4.Tried printing b and it gave null.
5.But printed a now, and the values were sorted.
 
 
Please help me understand if we have any logic with in a list to sort the 
values after an iteration.
Please apologize if I had missed some basics and uncovered it. 
 
>>> a = [1,4,3,2,4,5,3,2]
>>> a
[1, 4, 3, 2, 4, 5, 3, 2]
>>> print (a)
[1, 4, 3, 2, 4, 5, 3, 2]
>>> b = a.sort()
>>> b
>>> print (a)
[1, 2, 2, 3, 3, 4, 4, 5]
>>>

--
assignee: terry.reedy
components: IDLE
messages: 365129
nosy: Sivasundar Nagarajan, terry.reedy
priority: normal
severity: normal
status: open
title: List sorting
type: resource usage
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com