joshua0: (Default)
[personal profile] joshua0
joshua@escape:~$ python
Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> foo = 1
>>> type(foo)
<type 'int'>
>>> type(type(foo))
<type 'type'>
>>> kind(type(foo))
Traceback (most recent call last):
  File "", line 1, in 
NameError: name 'kind' is not defined
>>>
:(
Date: 2010-06-04 03:51 pm (UTC)

alanv: (Domoslide)
From: [personal profile] alanv
I don't understand... what exactly is the problem here? Sounds like "kind" isn't a valid method/construct in Python.
Date: 2010-06-04 07:28 pm (UTC)

From: [identity profile] wjl.livejournal.com
It's a type theory joke: it is well known that programming languages with a "type of all types" are inconsistent when viewed as logics and have an undecidable type checking problem. The usual "fix" is to say that "type" itself is not actually a type, but rather a higher-level entity called a "kind"; in this way, one has that kinds are the "types of types". (Other kinds might include the function kind "type => type", which is the kind of type operators like "list".)

Of course, Python doesn't really have these problems because it's not really a programming language at all -- it's just some horrible abomination that type theorists can poke fun at ;)
Date: 2010-06-04 05:04 pm (UTC)

Page generated Mar. 29th, 2026 09:01 pm
Powered by Dreamwidth Studios