[New-bugs-announce] [issue13755] str.endswith and str.startswith do not take lists of strings

py.user report at bugs.python.org
Tue Jan 10 05:09:29 CET 2012


New submission from py.user <port139 at yandex.ru>:

>>> 'abcd'.endswith(['a', 'b'])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: Can't convert 'list' object to str implicitly
>>>

it would be nice like in str.join
>>> ''.join(('a', 'b'))
'ab'
>>> ''.join(['a', 'b'])
'ab'
>>> ''.join({'a', 'b'})
'ab'
>>> ''.join({'a': 1, 'b': 2})
'ab'
>>>

----------
components: Interpreter Core
messages: 151002
nosy: py.user
priority: normal
severity: normal
status: open
title: str.endswith and str.startswith do not take lists of strings
type: behavior
versions: Python 3.1

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


More information about the New-bugs-announce mailing list