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.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/NPYFTJPKYCDPUM5OMBEOD5UPZ5GXU5NY/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to