I have recently started using tcl to do this with C++ code and will
soon be switching to doing it with python.
I think it is a fantastic way to arrange to test C++ and C code.
Python makes an excellent test-harness, and writing interfaces for
complex units of C++ code to enable them to be tested f
Your suggestion ('_name' -> implementation, 'name' -> API) makes sense
as a convention between programmers that know a fair amount about each
other's classes before using them.
I don't think it is reasonable in general to only subclass from base
classes you have studied the full API of, however.
I see what you mean now.
It would indeed be enlightening if I wanted to study the internals of
Tkinter, and perhaps one day I will.
--
http://mail.python.org/mailman/listinfo/python-list
Fredrik Lundh wrote:
> [EMAIL PROTECTED] wrote:
>
> > Now, 'i' might have already been defined by A or by the call to
> > A.__init__() so if you define it without knowing that, you could be
> > changing the behavior of A's methods in unknown ways, which is
> > obviously a bad thing.
>
> http://doc
Steve Juranich wrote:
> This should prove most enlightening:
>
> import Tkinter
> dir(Tkinter.Canvas)
>
>
Huh?
Chris Marshall
--
http://mail.python.org/mailman/listinfo/python-list
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, and you want to define a data member i in your
constructor.
As in the following:
from module1 import A
class B(A):
def __init__(self)