need dict to maintain order

Alex Martelli aleax at aleax.it
Sat Jan 19 09:36:24 EST 2002


rihad wrote:
        ...
> self.links = ( \
> ('index.html', 'Home'), \
> ('prog.html', 'Programming'), \
> ('doc.html', 'Docs'), \
> )

No need for these \ here: the logical line proceeds until the
closing ) to balanche out the leading, opening (.  Remove
the backslashes and gain a tiny bit of elegance at no cost.

> (sorry, didn't `tabs2spaces' the code since tabs are natural (?) in
> python anyway)

Maybe, but KNode (the newsreader from KDE 2, my chosen
desktop environment on LInux) seems to be removing or
hiding from me the indentation in this case (when I reply,
only; I can see the indentation when just reading -- it's
even worse with Outlook Express on Windows...).

This makes further commenting too hard.  Please use spaces,
not tabs, in code you post or otherwise publish, because tools
vary in their ability to handle tabs (and it's unlikely I'll change
newsreaders just because the two I prefer don't handle tabs
correctly:-).


Alex




More information about the Python-list mailing list