pylint woes

D'Arcy J.M. Cain darcy at VybeNetworks.com
Sun May 8 08:50:06 EDT 2016


On Sun, 8 May 2016 14:21:49 +1000
Chris Angelico <rosuav at gmail.com> wrote:
> if verbose:
>     verbiage = print
> else:
>     def verbiage(*args): pass

I have never understood why the def couldn't start on the same line as
the else:
 
if verbose: verbiage = print
else: def verbiage(*args): pass
 
The colon effectively starts a block so why not allow it?
 
By the way, I think you meant "def verbiage(*args, **kws): pass"

> Then, instead of "if verbose: print(var)", you would use
> "verbiage(var)". Of course, you want something better than "verbiage"
> as your name; the nature of your verbose output might give a clue as
> to what name would work.

How about "print"?

if not verbose:
    def print(*args, **kws): pass
    
-- 
D'Arcy J.M. Cain
Vybe Networks Inc.
http://www.VybeNetworks.com/
IM:darcy at Vex.Net VoIP: sip:darcy at VybeNetworks.com



More information about the Python-list mailing list