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
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
--
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
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
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
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
___
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
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
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
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
___
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
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
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
Changes by Florent Xicluna florent.xicl...@gmail.com:
--
nosy: +flox
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12170
___
___
Python-bugs-list
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
___
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.
--
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
___
Changes by STINNER Victor victor.stin...@haypocalc.com:
--
nosy: +haypo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12170
___
___
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
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
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 -
21 matches
Mail list logo