Esempio n. 1
0
        /// <summary>
        ///     Get a PyObject from an integer
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public PyObject From(bool value)
        {
            if (value && _pyTrue == null)
            {
                _pyTrue = new PyObject(this, Py.PyBool_FromLong(1), true);
            }

            if (!value && _pyFalse == null)
            {
                _pyFalse = new PyObject(this, Py.PyBool_FromLong(0), true);
            }

            return(value ? _pyTrue : _pyFalse);
        }