Register   Login   About   Study   Enterprise   Share
Internet / AI Technology University (ITU/AITU)
Fast Login - available after registration







|

Top Links: >> 80. Technology >> Internet Technology Summit Program >> 9. AI with Python >> 9.1. The Python Tutorial Introduction >> 9.1.1. Python Docs, Lexicon, and Components >> 9.1.1.3. Python Internals
Current Topic: 9.1.1.3.51. Boolean Objects
You have a privilege to create a quiz (QnA) related to this subject and obtain creativity score...

Booleans in Python are implemented as a subclass of integers. There are only two booleans, Py_False and Py_True. As such, the normal creation and deletion functions don?t apply to booleans. The following macros are available, however.




int
PyBool_Check
(
PyObject
 *o
)



Return true if o is of type PyBool_Type.






PyObject*
Py_False



The Python False object. This object has no methods. It needs to be treated just like any other object with respect to reference counts.






PyObject*
Py_True



The Python True object. This object has no methods. It needs to be treated just like any other object with respect to reference counts.



Was it clear so far?



Py_RETURN_FALSE



Return Py_False from a function, properly incrementing its reference count.






Py_RETURN_TRUE



Return Py_True from a function, properly incrementing its reference count.






PyObject*
PyBool_FromLong
(long
 v
)



Return value: New reference.

Return a new reference to Py_True or Py_False depending on the truth value of v.








| Check Your Progress | Propose QnA | Have a question or comments for open discussion?

Have a suggestion? - shoot an email
Looking for something special? - Talk to me
Read: IT of the future: AI and Semantic Cloud Architecture | Fixing Education
Do you want to move from theory to practice and become a magician? Learn and work with us at Internet Technology University (ITU) - JavaSchool.com.

Technology that we offer and How this works: English | Spanish | Russian | French

Internet Technology University | JavaSchool.com | Copyrights © Since 1997 | All Rights Reserved
Patents: US10956676, US7032006, US7774751, US7966093, US8051026, US8863234
Including conversational semantic decision support systems (CSDS) and bringing us closer to The message from 2040
Privacy Policy