Three-valued logic is fine for some purposes. Bending boolean
two-valued constants to play the part of three-valued is confusing and
wrong.
Why? The variable in question gives an answer to the question:
Has the user requested a connection.
To which the answer can be:
1: No
2: Yes
3: Yes and the connection ID is ...
So tell me what is wrong with using False and True for the simple
No and Yes answer in this case?
No. Using False and True is a strong signal to the reader that you're
using *two* value logic. If you break that expectation, the reader
should not be expected to sympathise.
IMO that expectation is unpythonic. Python allows that a variable
can be of different types during its lifetime. There is even no
mechanism to limit a variable to a specific type. So there is no
reason to expect a variable is limited to False and True just
because one of those was used. Just as there is no reason to
expect a variable will always be an integer just because it
was assigned an integer constant at some point.
As another poster suggested, if you want to implement three-valued
logic, use three new objects to represent the states, so the reader
*knows* there's something going on other than two-value logic. Don't
re-use False and True in three-valued logic and expect anyone to
understand your code.
I thought that was the purpose of documentation.