Real Problems with Python
Michael Hudson
mwh21 at cam.ac.uk
Mon Feb 14 14:38:09 EST 2000
Charles Hixson <charleshixsn at earthlink.net> writes:
> Well, in Eiffel one would need to declare the inheritance pattern to
> by used by x wouldn't you?
Fair point.
> Where Python doesn't have declarations
> of variables. I suppose that one could interpolate a rule that said
> something like:
> "The value of a variable inherited from more than one ancestor class must be
> prefixed by the name of the class from which it was inherited."
> Which shouldn't break any code that was currently safe. The other
> alternative would be to require that those variables be renamed (in
> essence, the Eiffel solution) ..
> Thus:
> for Foo.x use fooX
> for Bar.x use barX
> etc.
>
> Neither solution seems to fit *really* nicely into Python. Neither
> clashes very badly. My personal preference is the renaming
> solution, because otherwise occasionally names will grow too long to
> be convenient. But it doesn't seem a difficult problem, merely a
> real one.
It's not exactly an area I know a huge amount about, but I do know
that in Eiffel you can still get yourself in trouble along these lines
(I'm not too sure how; people who know more than I have claimed this),
and Eiffel is about the most carefully-designed-to-type-safety OO
langauge I know of, so I'd say it was a difficult problem.
Cheers,
M.
More information about the Python-list
mailing list