Christoph Wruck added the comment:
closed as redundant to:
http://bugs.python.org/issue27008
--
resolution: -> not a bug
status: open -> closed
title: ord() raises TypeError in string input -> ord() raises TypeError on
string/by
Changes by Christoph Wruck <christoph.wr...@gmail.com>:
--
type: enhancement -> behavior
___
Python tracker <rep...@bugs.python.org>
<http://bugs.pyt
Changes by Christoph Wruck <christoph.wr...@gmail.com>:
--
type: -> enhancement
___
Python tracker <rep...@bugs.python.org>
<http://bugs.pyt
New submission from Christoph Wruck:
Hi,
is there any reason why ord() raises a TypeError instead of ValueError on
string/bytes input with wrong length?
The chr() function will raise a ValueError on negative integers such as chr(-1).
Required behaviour:
try:
n = ord(input_string)
except
New submission from Christoph Wruck:
Currently we have a split function which splits a str/bytestr into
chunks of their underlying data. This works great for the most tivial jobs.
But there is no possibility to pass an offset parameter into the split
function which indicates the next user
Christoph Wruck added the comment:
Hi Steven
exactly - you're right with this.
'spam--eggs--cheesetoast'.split('-', offset=1)
-- ['spam', '-eggs', '-cheese', '-', '-toast']
'spam--eggs--cheese--toast'.split('-', offset=8)
-- ['spam', '-eggs--cheese', '-toast']
Okay - the name offset
Christoph Wruck added the comment:
Serhiy, you will be right if you've to split a complex string such spliting
strings with more than one separator. In this case I would prefer a regex bases
solution too. Otherwise we could actually use the re-lib for every of those
jobs without using
Christoph Wruck added the comment:
David, I'll reflect on it. @ALL - Thank's for all answers.
Should I close this ticket?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22360