Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #31165

Re: __setitem__ without position

Date 2012-10-12 09:16 -0700
From Ethan Furman <ethan@stoneleaf.us>
Subject Re: __setitem__ without position
References <CA+C4C6c7GBdxs+jZPGNrpauvZXP7caGpPb8Q466HD7mV09731Q@mail.gmail.com> <CA+C4C6eMKa6i4Vk4b7hc8SxyDyutoRKkP9VLt0g3UWs+v5ehTw@mail.gmail.com> <50773AE5.7020400@davea.name> <k57lr2$umt$1@ger.gmane.org>
Newsgroups comp.lang.python
Message-ID <mailman.2091.1350058892.27098.python-list@python.org> (permalink)

Show all headers | View raw


Terry Reedy wrote:
> In 3.x, you would write __setitem__ to recognize that the 'key' is a 
> slice object rather than an int and act accordingly. (In 2.x, you would 
> write __setslice__.) 

I'm not sure how far back it goes, but at least from 2.4 forward 
__setitem__ works with slices just fine.

~Ethan~

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: __setitem__ without position Ethan Furman <ethan@stoneleaf.us> - 2012-10-12 09:16 -0700

csiph-web