Handling slices

Jp Calderone exarkun at intarweb.us
Mon Apr 7 01:38:51 EDT 2003


On Mon, Apr 07, 2003 at 03:54:17AM +0100, Alexander Schmolck wrote:
> [snip]
> 
> Here is a simple example:
> 
> class SliceMaker:
>     """Convinience class to make slices."""
>     def __getitem__(self, a): return a
> 

  It may be worth noting that this is essentially the slice() builtin.

  Jp

-- 
It is practically impossible to teach good programming style to
students that have had prior exposure to BASIC: as potential
programmers they are mentally mutilated beyond hope of
regeneration.        -- Dijkstra
-- 
 up 18 days, 1:01, 0 users, load average: 0.00, 0.00, 0.00





More information about the Python-list mailing list