Re: data hiding/namespace pollution
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: data hiding/namespace pollution

From: Alex Hunsley <lard@tardis.ed.ac.molar.uk>
Date: Mon Oct 31 2005 - 12:39:37 CET

Jorge Godoy wrote:
> Alex Hunsley <lard@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.

Yup, I'm plannig on using pyunit. Didn't know about pychecker though,
thanks for that!
Received on Mon Nov 21 01:07:38 2005