F
Frans Englich
Hello,
I take PyChecker partly as an recommender of good coding practice, but I
cannot make sense of some of the messages. For example:
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?
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?
A common message is these:
runner.py:41: Parameter (frame) not used
But I'm wondering if there's cases where this cannot be avoided. For example,
this signal handler:
#-------------------------------------------
def signalSilencer( signal, frame ):
"""
Dummy signal handler for avoiding ugly
tracebacks when the user presses CTRL+C.
"""
print "Received signal", str(signal) + ", exiting."
sys.exit(1)
#-------------------------------------------
_must_ take two arguments; is there any way that I can make 'frame' go away?
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"
Thanks in advance,
Frans
PS. Any idea how to convert any common time type to W3C XML Schema datatype
duration?
I take PyChecker partly as an recommender of good coding practice, but I
cannot make sense of some of the messages. For example:
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?
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?
A common message is these:
runner.py:41: Parameter (frame) not used
But I'm wondering if there's cases where this cannot be avoided. For example,
this signal handler:
#-------------------------------------------
def signalSilencer( signal, frame ):
"""
Dummy signal handler for avoiding ugly
tracebacks when the user presses CTRL+C.
"""
print "Received signal", str(signal) + ", exiting."
sys.exit(1)
#-------------------------------------------
_must_ take two arguments; is there any way that I can make 'frame' go away?
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"
Thanks in advance,
Frans
PS. Any idea how to convert any common time type to W3C XML Schema datatype
duration?