This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2011年06月21日 03:57 by py.user, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Messages (5) | |||
|---|---|---|---|
| msg138770 - (view) | Author: py.user (py.user) * | Date: 2011年06月21日 03:57 | |
>>> bytearray(b'abc').count(bytearray(b''), None) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: slice indices must be integers or None or have an __index__ method >>> bytearray(b'abc').find(bytearray(b''), None) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: slice indices must be integers or None or have an __index__ method >>> bytearray(b'abc').index(bytearray(b''), None) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: slice indices must be integers or None or have an __index__ method and duplicate issues (endswith and startswith): >>> bytearray(b'abc').endswith(bytearray(b''), None) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: slice indices must be integers or None or have an __index__ method >>> bytearray(b'abc').startswith(bytearray(b''), None) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: slice indices must be integers or None or have an __index__ method >>> |
|||
| msg138785 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2011年06月21日 13:00 | |
As Raymond said in another issue, someone should fix this once and for all by factoring this check out into a reusable method and making sure it is used everywhere. |
|||
| msg138994 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2011年06月24日 21:59 | |
Note that both of these have been fixed in default, so I'm repurposing this issue for the refactoring I suggested. However, since I can't find an existing issue for the bytearray fix, maybe somebody already did it and I didn't notice. |
|||
| msg140519 - (view) | Author: anand jeyahar (anand.jeyahar) | Date: 2011年07月17日 08:54 | |
I started working on this. But found sliceobject.c. Think it would be a good idea to add the refactored functions there. Anyway, i was trying to figure out the functionality of sliceobject.c. Can someone put up a use/test case example for it? Thanks for patience with my newbieness to python source |
|||
| msg141217 - (view) | Author: Petri Lehtinen (petri.lehtinen) * (Python committer) | Date: 2011年07月27日 10:35 | |
R. David Murray wrote: > Note that both of these have been fixed in default, so I'm > repurposing this issue for the refactoring I suggested. > However, since I can't find an existing issue for the bytearray > fix, maybe somebody already did it and I didn't notice. It seems to me that such refactorization has been already done when fixing issue 11828. The stringlib_parse_args_finds() function is used to to parse the slice-like arguments of str, bytes and bytearray functions. As the errors reported in the issue have already been fixed in all branches, I'm closing this as invalid. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:18 | admin | set | github: 56590 |
| 2011年07月27日 10:35:58 | petri.lehtinen | set | status: open -> closed resolution: not a bug messages: + msg141217 |
| 2011年07月17日 08:54:26 | anand.jeyahar | set | nosy:
+ anand.jeyahar messages: + msg140519 |
| 2011年06月25日 09:05:56 | mark.dickinson | set | nosy:
+ mark.dickinson |
| 2011年06月24日 21:59:38 | r.david.murray | set | title: bytearray methods count, find, index don't support None as in slice notation -> refactor slice checks made by methods that take "slice like" arguments messages: + msg138994 versions: - Python 2.7, Python 3.2 |
| 2011年06月21日 18:33:30 | petri.lehtinen | set | nosy:
+ petri.lehtinen |
| 2011年06月21日 13:17:39 | xuanji | set | nosy:
+ xuanji |
| 2011年06月21日 13:00:28 | r.david.murray | set | versions:
+ Python 3.2, Python 3.3, - Python 3.1 nosy: + r.david.murray messages: + msg138785 keywords: + easy |
| 2011年06月21日 03:57:16 | py.user | create | |