I can see why you would want to see True/False there, but to get the value, you need to specifically return what you want because AFAIK the body is wrapped in a function that is evaluated to get the value, it is not simply the last thing that gets evaluated. Your example clarified to me at least why it would be tricky to figure it out, you can't rely on the last line, for example. I don't know if there is some special Python variable that contains that.
It is also a little strange to me to put return specifically in like this:
#+begin_src python :session :results value
if some_condition:
a = True
else:
a = False
return a
#+end_src
or:
#+BEGIN_SRC python :results value
a = 1
return True if a else False
#+END_SRC
#+RESULTS:
: True
because it is not valid syntax in a script (try it with :results output), but this is how it has been for ob-python all along when what you want is the value returned.
John
-----------------------------------
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803