pseudoPython

Duncan Smith buzzard at urubu.freeserve.co.uk
Wed Mar 26 17:00:01 EST 2003


"Michael Chermside" <mcherm at mcherm.com> wrote in message
news:mailman.1048704166.20123.python-list at python.org...
> I found everything quite readable EXCEPT the line continuations.
> I'd probably try indenting your line continuations. For example:
>
>
>     line 1 of code:
>         line 2 of code
>         line 3 of code\
>         looks like line 4
>         actual line 4 of code
>
>
> could be improved with either of these:
>
>     line 1 of code:
>         line 2 of code
>         line 3 of code\
> clearly a continuation
>         actual line 4 of code
>
>
>     line 1 of code:
>         line 2 of code
>         line 3 of code\
>             clearly subsidiary to line 3
>         actual line 4 of code
>
> I personally prefer the last of these.
>
> -- Michael Chermside
>
>

Cheers Michael,
                         I seem to have forgotten to post my last function.
Just wondering whether a non-Pythonista would be able to follow this as
'tis, or whether I should be popping and pushing the cliques (pointers to
cliques) to a stack, or something.

Duncan


graphThin(DJT):

cliques = a list of cliques in elimination order

while cliques:
    nextClique = cliques[-1]
    cliques = clique[:-1]
    cliques = cliques + cliqueThin(nextClique)


or maybe,


graphThin(DJT):

cliques = a list of cliques in elimination order

while cliques:
    nextClique = cliques.pop()
    for newClique in cliqueThin(nextClique):
        cliques.append(newClique)

(although here I'm tempted to use 'push' rather than 'append', as it might
be clearer to those who know no Python?)






More information about the Python-list mailing list