data hiding/namespace pollution

Jorge Godoy godoy at ieee.org
Mon Oct 31 06:33:44 EST 2005


Alex Hunsley <lard at tardis.ed.ac.molar.uk> writes:

> Sorry, I wasn't being clear. What I should have said is that I don't like the
> idea of a typo in an assignment causing the assigning of the wrong thing.
> e.g. imagine a simple value-holding class:
> 
> class Values:
> 	pass
> 
> v = Values()
> 
> v.conductoin = 10
> 
> 
> ... I meant to type 'conduction' in the source but spelt it wrong.
> My value won't be there when elsewhere I refer to the correct attribute:
> "conduction".

Recently there was a big thread where that was raised again (yep, you're not
the first, nor the second, nor the third...).  You should write unittests, use
tools like pychecker, pylint, etc. 

-- 
Jorge Godoy      <godoy at ieee.org>



More information about the Python-list mailing list