if the else short form
Lawrence D'Oliveiro
ldo at geek-central.gen.new_zealand
Tue Oct 5 01:59:12 EDT 2010
In message <4ca96440$0$1674$742ec2ed at news.sonic.net>, John Nagle wrote:
> Yes, "bool" is a subtype of "int" in Python. This was
> because the original design of Python didn't have "bool"
> (a rather strange mistake for a language designed this late)
> and the retrofit had to have some backwards compatibility.
What’s the alternative? Java’s definition of “bool” is crap.
The Pascal/Ada approach was to introduce the general concept of “enumerated
types”, which were a subclass of “discrete types” (including integers and
subranges thereof). Boolean was just a built-in enumerated type.
What’s a language like Python, which has no enumerated types, to do?
More information about the Python-list
mailing list