derived / base class name conflicts

Ben Finney bignose+hates-spam at benfinney.id.au
Fri Nov 11 04:05:19 CET 2005


christopherlmarshall at yahoo.com wrote:
> Suppose you want to write a subclass of some existing class you are
> importing from a module you didn't write and that you don't want to
> study the internals of

No need to study its internals. Fire up a Python interpreter and
inspect its outside:

    >>> import foomodule
    >>> dir(foomodule.FooClass)

Any attributes named there should be avoided in your subclasses if you
don't want to clobber existing behaviour.

-- 
 \       "Those who will not reason, are bigots, those who cannot, are |
  `\     fools, and those who dare not, are slaves."  -- "Lord" George |
_o__)                                                Gordon Noel Byron |
Ben Finney



More information about the Python-list mailing list