ddfisher
Joined 17 years ago
Joined 17 years ago
[Source: I'm a mypy core developer.]
def f() -> "Bar": ...
instead of def f() -> Bar: ...
(This is normally used for forward references.) This makes it slightly less nice, but not a terrible workaround overall. def foo(n: int):
pass
def bar() -> None:
foo("123")
>> main: note: In function "bar":
>> main:4: error: Argument 1 to "foo" has incompatible type "str"; expected "int"You're right about the image, but the book is worthwhile.
[1] http://news.ycombinator.com/item?id=4509281
[2] http://www.ncbi.nlm.nih.gov/pubmed/2738212 (The book is not cited in the abstract, unfortunately, but I believe this is the correct study.)
(I'm not certain what "should" means in that sentence - a moral judgement? - but I'll interpret it as advice.) I think that this is excellent advice for some people, but poor advice for others. I don't think there is anything wrong, per se, with wanting to be the very best at something. There's just a trade-off: you can be happily excellent, or you can take a chance and be perhaps the best but most likely just unhappy. But this decision is, in my opinion, a personal one: happiness does not have to be the ultimate goal of life.
What can we do to stop things like this from happening again? There's clearly no quick-fix overnight solution, but there should be some set of actions we can take to slowly reduce/eventually eliminate this kind of violence. Any ideas?