Re: testing C code with python

2005-11-11 Thread christopherlmarshall
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

Re: derived / base class name conflicts

2005-11-11 Thread christopherlmarshall
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.

Re: derived / base class name conflicts

2005-11-11 Thread christopherlmarshall
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

Re: derived / base class name conflicts

2005-11-10 Thread christopherlmarshall
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

Re: derived / base class name conflicts

2005-11-10 Thread christopherlmarshall
Steve Juranich wrote: > This should prove most enlightening: > > import Tkinter > dir(Tkinter.Canvas) > > Huh? Chris Marshall -- http://mail.python.org/mailman/listinfo/python-list

derived / base class name conflicts

2005-11-10 Thread christopherlmarshall
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)