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/2006-July/067815.html below:

[Python-Dev] Bad interaction of __index__ and sequence repeat

[Python-Dev] Bad interaction of __index__ and sequence repeat [Python-Dev] Bad interaction of __index__ and sequence repeatGreg Ewing greg.ewing at canterbury.ac.nz
Sat Jul 29 04:50:21 CEST 2006
Armin Rigo wrote:

> This is because PySequence_Repeat(v, w) works by applying w.__index__ in
> order to call v->sq_repeat.

Why does it do that? Shouldn't __index__ only be used for
numbers which are going to be used as an index?

> However, __index__ is defined to clip the
> result to fit in a Py_ssize_t.

Why is it defined to do this instead of raising OverflowError?

--
Greg
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