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

Antoine Pitrou report at bugs.python.org
Tue Oct 18 13:35:28 CEST 2011


Antoine Pitrou <pitrou at 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 ‘stringlib_parse_args_finds_byte’:
Objects/stringlib/find.h:158:5: attention : implicit declaration of function ‘stringlib_parse_args_finds’
In file included from Objects/unicodeobject.c:497:0:
Objects/stringlib/find.h: Hors de toute fonction :
Objects/stringlib/find.h:151:1: erreur: redefinition of ‘stringlib_parse_args_finds_byte’
Objects/stringlib/find.h:151:1: note: previous definition of ‘stringlib_parse_args_finds_byte’ was here

I'd say you need to either define your function as STRINGLIB(parse_args_finds_byte) (to avoid name collisions), or avoid defining it if STRINGLIB_IS_UNICODE.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12170>
_______________________________________


More information about the Python-bugs-list mailing list