Hallöchen!
According to <http://docs.python.org/ref/sequence-methods.html>,
__getslice__ is deprecated. At the moment, I derive an own class
from unicode and want to implement my own slicing. I found that I
have to override __getslice__ since __getitem__ isn't called when I
have something like my_instance[a:b] in my code.
According to
<news:mailman.7 438.1102640455. 5135.python-list@python.org >, this may
have efficiency reasons, however, I agree with
news:1102645919 .114898.139820@ f14g2000cwb.goo glegroups.com that this
is quite confusing. It forces people to implement a deprecated
function after all. I think the docs should say that you still have
to override __getslice__ when subclassing from a built-in type,
unless I really don't understand the issue correctly.
Tschö,
Torsten.
--
Torsten Bronger, aquisgrana, europa vetus
Jabber ID: bronger@jabber. org
(See http://ime.webhop.org for ICQ, MSN, etc.)
According to <http://docs.python.org/ref/sequence-methods.html>,
__getslice__ is deprecated. At the moment, I derive an own class
from unicode and want to implement my own slicing. I found that I
have to override __getslice__ since __getitem__ isn't called when I
have something like my_instance[a:b] in my code.
According to
<news:mailman.7 438.1102640455. 5135.python-list@python.org >, this may
have efficiency reasons, however, I agree with
news:1102645919 .114898.139820@ f14g2000cwb.goo glegroups.com that this
is quite confusing. It forces people to implement a deprecated
function after all. I think the docs should say that you still have
to override __getslice__ when subclassing from a built-in type,
unless I really don't understand the issue correctly.
Tschö,
Torsten.
--
Torsten Bronger, aquisgrana, europa vetus
Jabber ID: bronger@jabber. org
(See http://ime.webhop.org for ICQ, MSN, etc.)
Comment