This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

作者 christian.heimes
收信人 christian.heimes, fijall, hynek, loewis, ncoghlan, petri.lehtinen, pitrou, python-dev
日期 2012-06-15.12:34:16
SpamBayes Score -1.0
Marked as misclassified
Message-id <4FDB2BC7.20703@cheimes.de>
In-reply-to <1339762713.3399.5.camel@localhost.localdomain>
内容
Am 15.06.2012 14:21, schrieb Antoine Pitrou:
> I like the fact that a C implementation can be audited much more easily.
> Who knows what kind of effects the Python implementation can trigger, if
> some optimizations get added in the future.

Secondly we can predict the function's timing on other implementations
of Python. Jython or PyPy might have different settings for small int
caching -- or non at all.

> The point of supporting unicode would precisely be to avoid a
> unicode->bytes conversion when unicode strings are received.

A byte-wise comparison of the memory representation would work IFF both
sides have the same type and unicode kind. Anything else could give away
details of the content.

Either:
PyBytes_CheckExact(a) && PyBytes_CheckExact(b)

or

PyUnicode_CheckExact(a) && PyUnicode_CheckExact(b) && PyUnicode_KIND(a)
== PyUnicode_KIND(b)

I'm not sure about CheckExact, just being paranoid.
历史
日期 用户 动作 参数
2012-06-15 12:34:17christian.heimes修改recipients: + christian.heimes, loewis, ncoghlan, pitrou, fijall, python-dev, petri.lehtinen, hynek
2012-06-15 12:34:17christian.heimes链接issue15061 messages
2012-06-15 12:34:16christian.heimes创建