Nick Coghlan <[email protected]> added the comment:
Rather than "is recommended by at least one core CPython developer" I'd say
"matches the way the CPython executable handles its own verbosity argument"
(check the output of "python --help")
Also, a better fix for the non-orderable types problem is to use "default=0"
when defining the verbosity arg rather than changing the test in the code.
Finally, the "not a superset" problem that I have with the way the running
example uses its verbosity argument is that it uses it to *change* the message
that gets displayed, instead of using it to *display more messages* at higher
verbosity levels.
>From that point of view, more idiomatic usage might look something like:
if verbosity >= 2:
print("Running {!r}".format(self.__file__)
if verbosity >= 1:
print("Calculating {}^2".format(args.square)
print(answer)
However, I'll grant that things like test runners do use their verbosity
argument to switch from shorthand progress markers to printing out the test
names and results, so I can live with the examples as they are.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue14034>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com