A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2011-October/113895.html below:

[Python-Dev] Rename PyUnicode_KIND_SIZE ?

[Python-Dev] Rename PyUnicode_KIND_SIZE ? [Python-Dev] Rename PyUnicode_KIND_SIZE ?Antoine Pitrou solipsis at pitrou.net
Thu Oct 6 18:03:51 CEST 2011
On Thu, 06 Oct 2011 17:52:05 +0200
Victor Stinner <victor.stinner at haypocalc.com> wrote:
> index << (kind - 1) and index * PyUnicode_CHARACTER_SIZE(str) were used 
> in unicodeobject.c. It's not easy to understand this formula

  index * PyUnicode_CHARACTER_SIZE(str)

is quite easy to understand to me.
I find it less cryptic than PyUnicode_KIND_SIZE(kind, index), actually,
and I would advocate using the former and removing the latter.

> (PyUnicode_KIND_SIZE() is also a micro-optimization, it uses shift 
> instead of multiply.)

I don't know, but I think the compiler should be able to do that for
you.
Also, I don't think PyUnicode_KIND_SIZE would be used in a critical
loop. You would use PyUnicode_READ when doing one-character-at-a-time
stuff.

Regards

Antoine.


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4