1
from pypy.objspace.std.stdtypedef import *
2
from pypy.objspace.std.inttype import int_typedef
4
# XXX should forbit subclassing of 'bool'
7
def descr__new__(space, w_booltype, w_obj=None):
8
space.w_bool.check_user_subclass(w_booltype)
9
if space.is_true(w_obj):
14
# ____________________________________________________________
16
bool_typedef = StdTypeDef("bool", int_typedef,
17
__doc__ = '''bool(x) -> bool
19
Returns True when the argument x is true, False otherwise.
20
The builtins True and False are the only two instances of the class bool.
21
The class bool is a subclass of the class int, and cannot be subclassed.''',
22
__new__ = newmethod(descr__new__),
24
bool_typedef.acceptable_as_base_class = False