Ronald Oussoren <ronaldousso...@mac.com> added the comment:

There are more reasons to implement in C than just speed ;-). In my code I have 
two usecases for using PyDict_GetItemString, both not in performance critical 
code

1) Look up a hardcoded name in a dictionary. These could be switched to the Id 
API if that were public (and I might implement something like the Id API 
myself). 

2) Look up a name that is passed in as a "char*" from C code that's outside of 
my control.  This is a real use case for a PyDict_GetItemString API and not 
easilty converted to another API.

In PyObjC the majority of calls to PyDict_GetItemString are in the first 
category, while most of the latter would probably be better of using a 
PyDict_GetItemBytes API.  Although I definitely to not propose to add such an 
API to CPython.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35460>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to