[New-bugs-announce] [issue37443] Python Returns NoneType when convert a string to a list and using sort() method

exploiterv report at bugs.python.org
Fri Jun 28 15:08:30 EDT 2019


New submission from exploiterv <exploiterv at gmail.com>:

Python Returns NoneType when convert a string to a list and using sort() method

# Example Code :

>>> string = "python"
>>> new_list = list(string.splitlines())                          >>> new_list
['python']
>>> type(new_list)
<class 'list'>
>>> print(type(new_list.sort()))
<class 'NoneType'>
>>> new_list
['python']
>>> new = new_list.sort()
>>> new
>>> type(new)
<class 'NoneType'>
>>>

----------
assignee: terry.reedy
components: IDLE, Interpreter Core
messages: 346851
nosy: exploiterv, terry.reedy
priority: normal
severity: normal
status: open
title: Python Returns NoneType when convert a string to a list and using sort() method
type: compile error
versions: Python 3.5, Python 3.6, Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37443>
_______________________________________


More information about the New-bugs-announce mailing list