First, welcome to PhilSE! You're in the right place, and though your question presents in the language of programming logic, logic, language, and computation are all intertwined: consider the Curry-Howard Correspondence, for instance.
Now, Mauro's comments are the most important. Objects, be they metaphysical or programmatic, do not have truth values; rather truth values are assigned to propositions or statements which express relationships. In natural language, we call this a "complete thought". So, "Bob" does not have a truth value, but "Bob is in the room" does. This assignment of a truth value is a form of philosophical judgement, and in Frege's Logic (SEP), it is indicated by a single turnstile. From the article:
The judgement stroke is perhaps the aspect of Frege’s logic, in both versions, that has been the subject of the most controversy. Simply put, the judgement stroke, in the logic of Begriffsschrift, transforms a judgeable content into a judgement... ⊢A...
Today in philosophy, we say that an indicative statement expresses a proposition which has assertoric force. The idea is that in a theory of truth, the language that expresses the state of affairs (as in the correspondence theory of truth, for instance) expresses an attitude of the thinker. The fancy term in philosophy is called the propositional attitude. From WP:
A propositional attitude is a mental state held by an agent or organism toward a proposition... In philosophy, propositional attitudes can be considered to be neurally-realized causally efficacious content-bearing internal states (personal principles/values)... Linguistically, propositional attitudes are denoted by a verb (e.g. believed) governing an embedded "that" clause, for example, 'Sally believed that she had won'.
So, it is possible to paraphrase truth conditional semantics using propositional attitudes. Thus, when someone claims 'Snow is white' is true, we can use the propositional attitude to say that 'Someone believes that "Snow is white" is true'. For computers, we can simply substitute run-time. bool(Nothing)
can be expressed in the language of propositional attitude as 'The run-time system of the software evaluates "bool(Nothing)" to true.'
So, when a programmer tells a compiler to evaluate a statement in a for loop, what the run-time that the compiler's output operates on simply judges a statement it is processing to be true or false. So, let's say you write a iterative loop with an exit condition that the variable c
must be less than 10 to continue to operate. When the run-time begins to execute the for loop, if c=9
and the condition is `c<10', internally, the run-time assigns true and then executes the loop code within its own scope. We can say 'The run-time evaluates that the branch conditional is true', which is a propositional attitude.
In programming language design, we often return truth values in ways that don't occur in natural language. Consider the use of returning a true in a function which conducts an operation: ExecuteSomeFubar(argument)
. Here, the run-time executes the associated procedure, and might return a true statement to allow the software to check the operational status of the procedure. It is the equivalent to the judgement OperatedSuccesfully(ExecuteSomeFubar(argument))
. This allows the run-time to handle errors by explicitly using return types to indicate the status of execution in a distinct scope. Of course, more sophisticated programming languages include explicit constructs like try-catch-finally to manage separation of concerns.
Since procedures can be associated with Boolean types in software in accordance with the desires of the programmer, one is free to craft philosophical judgements as one sees fit. You cite as an example >>> bool(None) -> False
. Here, bool()
has been implemented to return false on the None type. Why false? Because it allows Python then, to use the None type as a synonym for false. The association of values of bools, ints, floats, custom user-types, etc. is specific to the design of the particular type system which allows us to execute code based conditionally on the associated type, as opposed to the value. For example, a judgement can be made based on values such as c==10
or it can be made based on type typeof(c)
. This greatly enhances the system of flow control.