Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Lua and Python (2020). Parent comment
Any function can error in any way imaginable, but if we're talking about built-ins...
`print(nil.."a")` -> "attempt to concatenate a nil value"
`print(({}).foo.bar)` -> "attempt to index a nil value (field 'foo')"
`table.insert(a, 1)` -> "bad argument #1 to 'insert' (table expected, got nil)"
On the Python side you get:
`None[1]` -> "TypeError: 'NoneType' object is not subscriptable"
`str.split(None, "d")` -> "TypeError: descriptor 'split' for 'str' objects doesn't apply to a 'NoneType' object"
There are no comments on this comment yet.
Any function can error in any way imaginable, but if we're talking about built-ins...
`print(nil.."a")` -> "attempt to concatenate a nil value"
`print(({}).foo.bar)` -> "attempt to index a nil value (field 'foo')"
`table.insert(a, 1)` -> "bad argument #1 to 'insert' (table expected, got nil)"
On the Python side you get:
`None[1]` -> "TypeError: 'NoneType' object is not subscriptable"
`str.split(None, "d")` -> "TypeError: descriptor 'split' for 'str' objects doesn't apply to a 'NoneType' object"