Hacker News new | past | comments | ask | show | jobs | submit login

It does. Note that it calls popcount_digit on each digit of the integer (a 'digit' here is 32 bits), which calls _Py_popcount32, which does map to a hardware instruction if possible: https://github.com/python/cpython/blob/f62ad4f2c4214fdc05cc4...



Ah, you are correct. Although I still take issue with "fast" in the comment I was replying to ;)




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: