[issue12170] index() and count() methods of bytes and bytearray should accept byte ints

2012-06-26 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 018fe1dee9b3 by Petri Lehtinen in branch 'default': What's new: Add myself as the contributor of issue 12170 http://hg.python.org/cpython/rev/018fe1dee9b3 -- ___ Python

[issue12170] index() and count() methods of bytes and bytearray should accept byte ints

2011-12-17 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 75648db1b3f3 by Victor Stinner in branch 'default': Issue #13623: Fix a performance regression introduced by issue #12170 in http://hg.python.org/cpython/rev/75648db1b3f3 --

[issue12170] index() and count() methods of bytes and bytearray should accept byte ints

2011-12-17 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: New changeset 75648db1b3f3 by Victor Stinner in branch 'default': http://hg.python.org/cpython/rev/75648db1b3f3 Issue #13623: Fix a performance regression introduced by issue #12170 in bytes.find() and handle correctly OverflowError

[issue12170] index() and count() methods of bytes and bytearray should accept byte ints

2011-11-24 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Just a thought: Would this change be worthy for the What's new in 3.3 list? I think so. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12170

[issue12170] index() and count() methods of bytes and bytearray should accept byte ints

2011-11-24 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 736b0aec412b by Petri Lehtinen in branch 'default': Add a What's New entry for #12170 http://hg.python.org/cpython/rev/736b0aec412b -- ___ Python tracker

[issue12170] index() and count() methods of bytes and bytearray should accept byte ints

2011-11-23 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Just a thought: Would this change be worthy for the What's new in 3.3 list? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12170 ___

[issue12170] index() and count() methods of bytes and bytearray should accept byte ints

2011-10-20 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset c1effa2cdd20 by Antoine Pitrou in branch 'default': Issue #12170: The count(), find(), rfind(), index() and rindex() methods http://hg.python.org/cpython/rev/c1effa2cdd20 -- nosy: +python-dev

[issue12170] index() and count() methods of bytes and bytearray should accept byte ints

2011-10-20 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Patch committed, thank you! -- assignee: rhettinger - resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org

[issue12170] index() and count() methods of bytes and bytearray should accept byte ints

2011-10-19 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Thanks for the review, Antoine. Attached an updated the patch: - The function definition now uses STRINGLIB(...) and the function is only defined when !STRINGLIB_IS_UNICODE (so I took both approaches) - Added a versionadded:: 3.3 to the

[issue12170] index() and count() methods of bytes and bytearray should accept byte ints

2011-10-19 Thread Petri Lehtinen
Changes by Petri Lehtinen pe...@digip.org: Removed file: http://bugs.python.org/file23464/issue12170_v2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12170 ___

[issue12170] index() and count() methods of bytes and bytearray should accept byte ints

2011-10-19 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Fixed a minor inconsistency. -- Added file: http://bugs.python.org/file23465/issue12170_v2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12170

[issue12170] index() and count() methods of bytes and bytearray should accept byte ints

2011-10-18 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: I made the decision to raise a ValueError decision because __contains__ of both bytes and bytearray raise a ValueError when passed an integer not in range(0, 256). That sounds reasonable. OverflowError would have been another choice, but I

[issue12170] index() and count() methods of bytes and bytearray should accept byte ints

2011-10-18 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Doc/library/stdtypes.rst needs a versionadded tag for the additional semantics. Also, the patch doesn't compile fine on current default: In file included from Objects/unicodeobject.c:487:0: Objects/stringlib/find.h: In function

[issue12170] index() and count() methods of bytes and bytearray should accept byte ints

2011-10-18 Thread Florent Xicluna
Changes by Florent Xicluna florent.xicl...@gmail.com: -- nosy: +flox ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12170 ___ ___ Python-bugs-list

[issue12170] index() and count() methods of bytes and bytearray should accept byte ints

2011-08-01 Thread Raymond Hettinger
Raymond Hettinger raymond.hettin...@gmail.com added the comment: See also #12631 regarding the remove() method for bytearray. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12170 ___

[issue12170] index() and count() methods of bytes and bytearray should accept byte ints

2011-08-01 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: See also #12631 regarding the remove() method for bytearray. AFAICS, it's about bytearray.remove() working but bytearray.index() not working as documented, and that's why I marked is as a duplicate of this issue. --

[issue12170] index() and count() methods of bytes and bytearray should accept byte ints

2011-07-27 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Ok, so the current raising semantics should be good. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12170 ___

[issue12170] index() and count() methods of bytes and bytearray should accept byte ints

2011-07-27 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12170 ___ ___

[issue12170] index() and count() methods of bytes and bytearray should accept byte ints

2011-07-23 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Attached a patch with the following changes: Allow an integer argument in range(0, 256) for the following bytes and bytearray methods: count, find, index, rfind, rindex. Initially, only count and index were targeted, but as index is implemented

[issue12170] index() and count() methods of bytes and bytearray should accept byte ints

2011-07-23 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: When an integer out of range(0, 256) is passed as the first argument, should we raise a ValueError or a TypeError? ValueError = Inappropriate argument value (of correct type). TypeError = Inappropriate argument type. Currently, a

[issue12170] index() and count() methods of bytes and bytearray should accept byte ints

2011-07-22 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: This affects bytearray as well as bytes. What comes to supporting integer argument to str methods, I'm -1 on that. str's contained items are strings of length 1. -- title: Bytes.index() and bytes.count() should accept byte ints -