Message63271
| Author |
gvanrossum |
| Recipients |
amaury.forgeotdarc, gvanrossum, jek, rhettinger |
| Date |
2008年03月05日.00:12:29 |
| SpamBayes Score |
0.014048479 |
| Marked as misclassified |
No |
| Message-id |
<ca471dc20803041612x3447f223xcd88a287e09e8be8@mail.gmail.com> |
| In-reply-to |
<1204675534.46.0.248429057265.issue2235@psf.upfronthosting.co.za> |
| Content |
> I noticed that my patch uses Py_TYPE(self)->tp_hash, whereas normal
> processing of slot_tp_hash() uses lookup_method(self,"__hash__",hash_str).
>
> I am almost sure that both expressions return the same value.
> Is this correct? Py_TYPE(self)->tp_hash seems much faster.
HERE BE DRAGONS
There are cases where Py_TYPE(self)->tp_hash is the function currently
executing (some wrapper(s) in typeobject.c). OTOH, lookup_method(...)
finds the Python code in the class __dict__s along the MRO. |
|