[Tutor] Efficiency of Doxygen on Python vs C++?

Stephen McInerney spmcinerney at hotmail.com
Fri Aug 17 22:15:00 CEST 2007

Eric, you misunderstood my point.
I said you make a **token** assignment in the class defn simply
to do two things:
- 1) identify all the members in one place
- 2) annotate each member's type, as much as you can

class C
s = []
d = {}
ot = (None, None)

I didn't say you make the actual assignment. Obviously you can't
in most cases.


>From: Eric Brunson <brunson at brunson.com>

>>Is this not just evidence of a very bad Python coding style?
>>Should we not always declare *all* class fields in the class definition
>>by assigning to them, even if the assignment is token or dummy
>>i.e. 'None', "", [], {} etc.
>Absolutely not.  I have several classes that build themselves dynamically 
>at runtime.  As an example, one of them reads the data dictionary of a 
>database.  You may as well suggest that you define all your dictionary keys 
>at the beginning of the program.

A new home for Mom, no cleanup required. All starts here. 

More information about the Tutor mailing list