Isaul Vargas <isa...@gmail.com> added the comment:

There is no bug.
It's a bit confusing that the method sort on a list object returns None, but it 
is doing an in-place, (in memory) sort of the list, thus modifying the list. 

The function sorted however, will return a new list object.

The following interpreter session will show this:
>>> l = [3, 2, 1]
>>> type(l.sort())
<class 'NoneType'>
>>> print(l)
[1, 2, 3]
>>> new_list = [7, 5, 4]
>>> sorted(new_list)
[4, 5, 7]
>>> new_list
[7, 5, 4]

----------
assignee:  -> terry.reedy
components: +IDLE
nosy: +Dude-X, terry.reedy -SilentGhost
type: behavior -> compile error

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue37443>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to