Re: 2.2.2 Annoyance

From: Michael Hudson (mwh_at_python.net)
Date: 11/26/03


Date: Wed, 26 Nov 2003 12:06:51 GMT


"Miklós" <nospam@nowhere.hu> writes:

> I understand the rationale for deprecating '__getslice__' from v2.0
> onwards was to make sequences and mappings to look more alike. But
> then this change for __getitem__ should have been absolutely
> introduced at that time or the semantics of CPython between 2.0 and
> 2.2 doesn't make sense in this respect... Am I right in that?

Well, sort of. Back in the 2.0 days you couldn't even write:

>>> [].__getitem__

so

>>> [].__getitem__(slice(0,1))

was right out! It's all a bit messy, and it's sorted out in 2.3.

Cheers,
mwh

-- 
  Monte Carlo sampling is no way to understand code.
                                  -- Gordon McMillan, comp.lang.python


Relevant Pages

  • Re: [RFC] Reserve huge pages for reliable MAP_PRIVATE hugetlbfs mappings
    ... mappings than large pages exist for (or can be allocated for in the event ... is currently inconsistent as MAP_SHARED always tries to reserve the pages. ... in the beginning we had pre-fault semantics for all ... It's also common in languages who don't support dynamic allocation well (like ...
    (Linux-Kernel)
  • Re: Array and Hash-Table References
    ... We've heard some cons, but on the pro side, functions and the data ... structures you mention alike are mappings. ...
    (comp.lang.lisp)
  • Re: 24 Hour Day
    ... but only some mappings meet the more restrictive ... mapping you demanded (one-to-one, and preserving operator semantics). ... Number systems are more fun than one might think! ...
    (talk.origins)