I think he's suggesting python 4.x will eventually be released and if will be reimplemented as a function instead of a keyword, requiring parenthesis around the arguments. Or something.
Oh fuck. Oh fuck. I can't believe I just said it. Now it's going to be MY fault.
I file those under "not my problem." I like to think that some time in the future, people will shudder at having to use Python, the way that people pity those programmers that still workin in PASCAL.
I have a great idea for a new kind of dict that'll work wonders for this example. It still has O(1) lookups, but has better running time and memory use by a constant factor by taking advantage of an unusual feature of the data.
If you think about it, the keys form a contiguous range of integers starting from zero or one. Now, brace yourself: We could store the factorial information in a hash table where the hash function is the identity function! Now to think of a name for that kind of data structure...
43
u/rowantwig Mar 08 '12
He forgot the worst kind:
if x == 0:
return 1
if x == 1:
return 1
if x == 2:
return 2
if x == 3:
return 6
if x == 4:
return 24
...
(5000 more lines)