osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Boolean comparison & PEP8


On Tue, Jul 30, 2019 at 12:04 AM David Raymond <David.Raymond at tomtom.com> wrote:
> if shell:
>     #wait, "shell" is not really a statement or an instruction. "If shell"... what? "I need to shell"? Is this whether we want to use a shell, or if we discovered that we're already in one? Or is "shell" not really a boolean, and is holding which shell we want, and we're just using the "truthyness" to make sure it's not None? What's going on here? Dangit, ok, where's the documentation?
> (subprocess is common enough that people know this, but imagine a much less frequently used module/function)
>

I suppose "use_shell" would be clearer, but a lot of verbs become
implicit with the right choice of noun, as some nouns can become
implicit with the right verb.

ChrisA