Re: [Tutor] Hiding Superclass Methods

2010-10-11 Thread Adam Bark
On 11/10/10 23:52, Steven D'Aprano wrote: On Tue, 12 Oct 2010 01:55:10 am Adam Bark wrote: On 11/10/10 15:29, Denis Gomes wrote: Thank you both for your responses. I do have one other question if I use the method both of you describe. How do I go about implementing slicing and indexi

Re: [Tutor] Hiding Superclass Methods

2010-10-11 Thread Steven D'Aprano
On Tue, 12 Oct 2010 01:55:10 am Adam Bark wrote: > On 11/10/10 15:29, Denis Gomes wrote: > > Thank you both for your responses. I do have one other question if > > I use the method both of you describe. How do I go about > > implementing slicing and indexing for an object in python? A list > > ob

Re: [Tutor] Hiding Superclass Methods

2010-10-11 Thread Denis Gomes
I understand where to go from here. Thanks to all who responded. Appreciate it. Denis ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Hiding Superclass Methods

2010-10-11 Thread Walter Prins
On 11 October 2010 15:55, Adam Bark wrote: > You can use __getslice__, __setslice__ etc. methods. They're detailed in > the list docstrings. Here's an example of using __getslice__ > > >>> dir([]) > ['__add__', '__class__', '__contains__', '__delattr__', '__delitem__', > '__delslice__', '__doc__'

Re: [Tutor] Hiding Superclass Methods

2010-10-11 Thread Dave Kuhlman
On Mon, Oct 11, 2010 at 08:25:24AM +0200, Knacktus wrote: > > Am 11.10.2010 06:24, schrieb Denis Gomes: > >Hi Everyone, > > > >I have a basic python question. I am writing an n dimensional vector > >class by inheriting from the builtin python list object. I want to be > >able to hide the par

Re: [Tutor] Hiding Superclass Methods

2010-10-11 Thread Adam Bark
On 11/10/10 15:29, Denis Gomes wrote: Thank you both for your responses. I do have one other question if I use the method both of you describe. How do I go about implementing slicing and indexing for an object in python? A list object innately has them and that is really why I wanted to use i

Re: [Tutor] Hiding Superclass Methods

2010-10-11 Thread Denis Gomes
Thank you both for your responses. I do have one other question if I use the method both of you describe. How do I go about implementing slicing and indexing for an object in python? A list object innately has them and that is really why I wanted to use it. I would appreciate it if you can point

Re: [Tutor] Hiding Superclass Methods

2010-10-11 Thread Alan Gauld
"Denis Gomes" wrote I have a basic python question. I am writing an n dimensional vector class by inheriting from the builtin python list object. I want to be able to hide the parent object's methods in the derived class instances. Doing so would break the Liskofff Substitution Princip

Re: [Tutor] Hiding Superclass Methods

2010-10-10 Thread Knacktus
Am 11.10.2010 06:24, schrieb Denis Gomes: Hi Everyone, I have a basic python question. I am writing an n dimensional vector class by inheriting from the builtin python list object. I want to be able to hide the parent object's methods in the derived class instances. Why inheriting then? A