[issue27092] ord() raises TypeError on string/bytes input

2016-05-23 Thread Christoph Wruck
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

[issue27092] ord() raises TypeError in string input

2016-05-23 Thread Christoph Wruck
Changes by Christoph Wruck <christoph.wr...@gmail.com>: -- type: enhancement -> behavior ___ Python tracker <rep...@bugs.python.org> <http://bugs.pyt

[issue27092] ord() raises TypeError in string input

2016-05-23 Thread Christoph Wruck
Changes by Christoph Wruck <christoph.wr...@gmail.com>: -- type: -> enhancement ___ Python tracker <rep...@bugs.python.org> <http://bugs.pyt

[issue27092] ord() raises TypeError in string input

2016-05-23 Thread Christoph Wruck
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

[issue22360] Adding manually offset parameter to str/bytes split function

2014-09-08 Thread Christoph Wruck
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

[issue22360] Adding manually offset parameter to str/bytes split function

2014-09-08 Thread Christoph Wruck
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

[issue22360] Adding manually offset parameter to str/bytes split function

2014-09-08 Thread Christoph Wruck
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

[issue22360] Adding manually offset parameter to str/bytes split function

2014-09-08 Thread Christoph Wruck
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