Encapsulation, inheritance and polymorphism

Mark Lawrence breamoreboy at yahoo.co.uk
Tue Jul 17 18:26:28 CEST 2012


On 17/07/2012 15:23, Lipska the Kat wrote:
> On 17/07/12 14:52, Roy Smith wrote:
>> In article<-8SdnVrXGqie25jNnZ2dnUVZ7qKdnZ2d at bt.com>,
>>   Lipska the Kat<lipska at lipskathekat.com>  wrote:
>>
>>> I'm not used to using variables without declaring their type
>>
>> If you truly wanted to recreate this type-bondage style of programming
>> in Python, it's easy enough to do.
>
> snip
>
> Well 'type-bondage' is a strange way of thinking about compile time type
> checking and making code easier to read (and therefor debug) but
> I'm not about to get into some religious war about declaring a variables
> type. I'll just say that I prefer to devote testing efforts to the real
> danger area which in my experience is 'user' input.

Why waste time testing, I thought that the compiler looked after 
everything? :)  But seriously you might want to look at the unittest 
module in the standard library.  There's also a separate mailing list 
for Python testing and I'm sure there's a wiki that compares the 
available tesing tools.  Google and ye shall find!!!

> Clients look dimly on runtime errors however they occur and if I can
> leave it to the compiler to check as much as possible then I'll take that.
>
> I do understand however that compiling an intepreted language doesn't
> really make sense however i'm sure there are interpreted languages that
> allow pre-execution type checking ... aren't there ? Oh yes, there's one
> called Java :-)

There are tools available to help here such as pylint, pychecker and 
pyflakes.  For other modules check out pypi at http://pypi.python.org/pypi

>
> Still, I'm sure you're only kidding around with me :-)

Kidding around on a Python mailing list, never, how dare you Sir, simply 
wouldn't be cricket :-)

>
> Lipska
>

-- 
Cheers.

Mark Lawrence.






More information about the Python-list mailing list