overwrite private method... (of wxColumnSorterMixin class)

Zachary Z_kline at hotmail.com
Mon Jan 19 08:00:03 EST 2004


"Florian Preknya" <bolo at coco.ro> wrote in message
news:bugj2p$vqj$1 at nebula.dnttm.ro...
> Is there a posibility to overwrite a private method (one that starts with
> __ ) ? I read that they are just formely private, they are prefixed with
the
> class name to have an obtured visibility, so maybe it's a trick here...
>
> More details...
> I use wxPython, more specifically the wxColumnSorterMixin class. I want to
> overwrite the __OnColClick event handler to behave on my way: I want the
> sorting feature will affect only some columns, not all columns and that
> event handler is the key. The problem is that the event chain is skiped in
> the __OnColClick method, so I cannot receive the event anymore. So, my
idea
> was to overwrite the __OnColClick method in the mixin subclass. Is this
> possible? Or, are they other solutions for this ?
>
> Thanks,
> Florian.
>
>
What you read is true, so far as I know.  It is possible to override them,
as Python doesn't have a notion of encapsulation, again, as far as I know.
You can probably get away with this.





More information about the Python-list mailing list