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/2012-March/117272.html below:

[Python-Dev] slice subscripts for sequences and mappings

[Python-Dev] slice subscripts for sequences and mappings [Python-Dev] slice subscripts for sequences and mappingsEli Bendersky eliben at gmail.com
Sat Mar 3 09:50:06 CET 2012
> This doesn't align well with the documentation, in at least two places.
>
<snip>

Another place is in http://docs.python.org/dev/reference/datamodel.html:

"
object.__getitem__(self, key)

    Called to implement evaluation of self[key]. For sequence types,
the accepted keys should be integers and slice objects. [...]
"

Once again, at the C API level this isn't accurate since only integer
keys are handled by the sequence protocol, leaving slice keys to the
mapping protocol.

The datamodel doc should stay as it is, because it's correct for
Python-written classes. But the relevant C API sections really need
some clarification.

Eli
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