Serhiy Storchaka added the comment:
PyArg_ParseTupleAndKeywords can be slower than PyArg_ParseTuple even for
positional arguments. We need benchmarking results (especially after committing
a patch for issue27574).
What is the purpose of adding support of the delete argument as keyword
arguments? It looks to me, that the only purpose is allowing to specify the
delete argument without specifying the table argument. There are two
alternative ways to achieve this: make translate() accepting some special value
(e.g. None) as the default value for the first argument:
b'hello'.translate(None, b'l')
or make translate() accepting the delete argument as keyword argument:
b'hello'.translate(delete=b'l')
The patch does both things, but only one is needed. If add the support of the
delete argument as keyword argument, I would prefer to not add the support of
None as the first argument, but would specify its default value as
bytes(range(256)):
table: object(c_default="NULL") = bytes(range(256))
/
delete as deletechars: object(c_default="NULL") = b''
I don't know why optional group was used here, the function could be
implemented without it.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue27506>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com