145 karma · joined Jan 21, 2010 (16y ago) · 30 submissions
comment 10y ago · link · parent
[Source: I'm a mypy core developer.]
comment 10y ago · link · parent
comment 10y ago · link · parent
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"7.
Who will sell the self-driving car?(blog.samgerstenzang.com ↗)
2 points · by ddfisher · 13y ago · discuss
8.
Who’s afraid of Jeff Bezos?(blog.samgerstenzang.com ↗)
87 points · by ddfisher · 13y ago · 81 comments
comment 14y ago · link · parent
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.)
comment 14y ago · link · parent
comment 14y ago · link · parent
(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.
comment 14y ago · link · parent
Disclaimer: I've made minor contributions to Phabricator and will be making larger ones shortly.
comment 15y ago · link · parent
benchmarking spark_mggcl
mean: 49.29483 us, lb 48.77776 us, ub 50.25594 us, ci 0.950
std dev: 3.495423 us, lb 2.140951 us, ub 6.373469 us, ci 0.950
benchmarking spark_ocharles
mean: 60.12347 us, lb 58.95586 us, ub 61.48084 us, ci 0.950
std dev: 6.434853 us, lb 5.529613 us, ub 7.824865 us, ci 0.950
The simpler version appears to be faster.(As an aside, is there something in particular you dislike about do syntax? I find that it often makes things more readable, though slightly more verbose.)
comment 15y ago · link · parent
From your comment history, I speculate that you - like me - are a long-time reader and only an occasional poster. These posts stand out as being unusually negative. I'd urge you to strongly consider changing your tone (and perhaps deleting your posts in this thread). Don't let this one altercation drive you away from the community.
Best -- David
comment 15y ago · link · parent
comment 15y ago · link · parent
Edit: Sorry if this comes off as overly didactic: I incorrectly assumed you were new. However, my main point still stands.
comment 15y ago · link · parent
comment 15y ago · link · parent
I'm not sure if you're making some subtle point here that I'm missing, but it is not the case that any of the elements of array will be accessed by that code if args.length is 0. If args.length is 0, then the exit condition (which is evaluated before entering the loop body for the first time) will be false, and the loop body will not be executed at all.