concise code (beginner)

bambam david at asdf.asdf
Mon Sep 10 03:42:25 CEST 2007

I'm testing a series of scripts.
The scripts are testing a series of hardware devices.
The scripts are a sequence of device commands.
The scripts have sequence numbers.

I am adding exception handling to the to the 'inner
platform' that executes sequences.

I am doing this because testing of error cases has
demonstrated that the 'inner platform' is fragile.

on the other hand:

In any case, the hardware test instruments are not programmable
in python, and most of them do not have loop constructs in the
platform language.

I'm not sure how you are reading these messages. Can you see the
thread history?


"Steven D'Aprano" <steven at> wrote in message 
news:pan.2007. at
> On Fri, 07 Sep 2007 12:03:26 +1000, bambam wrote:
>> Hi Steven.
>> Looking at your code, why are you naming the value __all__? It looks
>> like a built-in variable?
> When you say:
> from module import *
> Python looks in the module for a list of names called "__all__", and
> imports only the names in that list. It is recommended that your modules
> take advantage of that feature. I'm just using the same name.
>> Unless there is an automatic way to correctly get the function list, I
>> will probably be better off giving the lines sequence numbers, and
>> generating the function list from that.
> I don't understand what you mean by "giving the lines sequence numbers".
> Where do they come from? How do you go from sequence numbers to functions?
> As far as I am concerned, the right behavior is for the module containing
> the functions to define which functions need to be tested. Since modules
> aren't actually intelligent, that means some person needs to list the
> functions. Why list the function NAME when you can list the function
> itself?

More information about the Python-list mailing list