On Mon, Nov 18, 2019, at 14:04, Chris Angelico wrote:
If by "constant" you mean that they are immutable, then maybe; there aren't very many mutable callables (by comparison to the huge number of functions). But you can't assume that a function is as constant as a string literal.
I meant a constant in the sense that the name is never intended to be and never in fact reassigned. The kind of thing that when they're *not* callable, PEP8 says should be named in ALL_CAPS.
verbose = print if args.quiet: def verbose(*a, **kw): pass
Is 'verbose' now a variable, a function, a constant, a global, or what? How should it be highlighted?
I already conceded that this kind of thing is subjective around the edges, what more do you want? My opinion would be that it should be highlighted as a function, but I'm not sure how I'd define the criteria for this.