rogerb at rogerbinns.com
Tue Jan 11 02:28:42 EST 2005
> runner.py:878: Function (main) has too many lines (201)
> What does this mean? Cannot functions be large? Or is it simply an advice that
> functions should be small and simple?
It is advice.
> runner.py:200: Function (detectMimeType) has too many returns (11)
> The function is simply a long "else-if" clause, branching out to different
> return statements. What's wrong? It's simply a "probably ugly code" advice?
That is also advice. Generally you use a dict of functions, or some other
structure to lookup what you want to do.
> _must_ take two arguments; is there any way that I can make 'frame' go away?
Yes, you can name it just _ (underscore). There are a few other names like
that that are ignored. (Check the doc).
> Also, another newbie question: How does one make a string stretch over several
> lines in the source code? Is this the proper way?
> print "asda asda asda asda asda asda " \
> "asda asda asda asda asda asda " \
> "asda asda asda asda asda asda"
Depends what you are trying to achieve. Look at triple quoting as well.
More information about the Python-list