Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
ambivalence
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
11 ms
·
61.
▲
by
ambivalence
8y ago
Colons in slices are implemented to the letter of PEP 8. Your disagreement here probably stems from pycodestyle mistakenly enforcing a different rule (no spaces before colons on if-statements, defs, and so on) in the slice context. The lan
62.
▲
by
ambivalence
8y ago
I'm working on that. In the mean time use your Unix fu with `find | grep | grep -v | xargs black`.
63.
▲
by
ambivalence
8y ago
For a large codebase that uses Black, you might want to look at PyPA/Warehouse or Fabric 2.
64.
▲
by
ambivalence
8y ago
Originally PEP 8 had 79 characters. Now that was a weird choice so most companies went with 80 instead, including Facebook. You want a low-ish limit because it makes it possible to fit two files side by side on a typical screen resoluti
65.
▲
by
ambivalence
8y ago
What don't you like about the exceptions? The code and the documentation would both be simpler without them. They are there because the end result is closer to what a human would do in those situations. And the two exceptions you men
66.
▲
by
ambivalence
8y ago
Yeah, I wasn't willing to die on that hill, especially that I'm introducing a new default value that wasn't popular before.
67.
▲
by
ambivalence
8y ago
Black is a simple tool. It tries to implement a single code style well. It's not configurable. We tried YAPF before and could never roll it out for everybody. I even contributed the "facebook" style to the tool. There wer
68.
▲
by
ambivalence
8y ago
That shouldn't be hard to integrate. At Facebook we have it integrated with Buck which is pretty similar to Bazel.
69.
▲
by
ambivalence
8y ago
No. Supporting an entire new AST and type system (pattern matching) is a large investment. It can be made if there's enough of a userbase out there to justify it. That doesn't seem to be the case. Not yet at least.
70.
▲
by
ambivalence
9y ago
Judging from your confrontational tone I will probably regret commenting but here goes. Arguments accepted in __init__() are not necessarily tied to the so-called "shape of the type" at runtime. Fields with init=False, and the pre
71.
▲
by
ambivalence
9y ago
You don't ever push straight to the repo. You enqueue your changeset to be pushed by a central system. At Facebook we call this "asynchronous landing" and you're right, before this became a thing about five years back, a
72.
▲
by
ambivalence
9y ago
Saying it's "ironic" would be somewhat harsh (but would still get the point across), saying it's "amusing" is just cruel. You know there's real people affected and the ones hurt will likely not be the ones
73.
▲
by
ambivalence
9y ago
Doesn't it have the same butterfly keyboard as the new Macbook Pro?
74.
▲
by
ambivalence
9y ago
Since this is how gradual typing works, the goal is to annotate every last function. Good question about abstract base classes! Paraphrasing a well known cliché: types in functions should be forgiving in arguments (what the function accepts
75.
▲
by
ambivalence
9y ago
I'm not quite sure what you mean. Python has an external static checker for types, it's called mypy. Python's type annotations are in fact very similar to Flow and Hack in the sense that they provide gradual typing. The speci
76.
▲
by
ambivalence
9y ago
The idea to gather types at runtime is as old as PEP 484. The Dropbox and Facebook teams working on Python type checking know each other. We both worked on our implementations independently since we wanted to first test internally whether t
77.
▲
by
ambivalence
9y ago
MonkeyType is Python 3-centric, PyAnnotate is Python 2-centric. PyAnnotate couples re-applying the types with the tool, and uses type comments for this. MonkeyType generates .pyi files that you can either use directly or re-apply them to yo
78.
▲
Open-sourcing MonkeyType – Let your Python code type-hint itself
(engineering.instagram.com)
427 points
by
ambivalence
9y ago
|
229 comments
79.
▲
by
ambivalence
9y ago
Yes.
80.
▲
by
ambivalence
9y ago
I work at FB.
81.
▲
by
ambivalence
9y ago
Facebook's WWW is Hack. Instagram's WWW is Django on Python 3.6.
82.
▲
by
ambivalence
9y ago
New code at Facebook does use both. Instagram uses both extensively.
83.
▲
by
ambivalence
9y ago
> Not sure how accurate it is, but the way Facebook's founding ideas are portrayed in The Social Network definitely screams "exploiting human psychology". It's fiction. Yes, inspired by a true story but fiction noneth
84.
▲
by
ambivalence
9y ago
If you're using Apple CarPlay, don't upgrade (yet?). On iOS 11 it cannot even keep up playing music without glitches. Crashed twice on me when receiving a phone call. Never had those issues on iOS 10.3. Rebooting helps. Feels like
85.
▲
by
ambivalence
9y ago
This is happening but, unlike software, cannot be bootstrapped by a few hackathons. Just one example: http://www.businessinsider.com/facebook-housing-menlo-park-2...
86.
▲
by
ambivalence
9y ago
Well, I am editing remote code over SSH with Atom and Nuclide right now . It's been possible for a long time. Now you can even run a remote debugger on your Python program.
87.
▲
by
ambivalence
9y ago
> At one point he was planning to publish a book of his own aphorisms, as quoted by himself, while he is still alive. He did, it's called "The Bed of Procrustes". I quite enjoyed it, there's quite a few brilliant tho
88.
▲
by
ambivalence
10y ago
I use two 13" Macbook Airs. One is an 1.3 GHz i5 from 2013 which is admittedly slowish at times with heavy Atom and browser use. The other is an 2.2 GHz i7 from 2015 and that one is pretty awesome. The batteries on those machines are a
89.
▲
by
ambivalence
10y ago
Report the Bluetooth problem at the Subaru service. When my wife drives back from work, our '15 Forester pairs with my phone on the kitchen table as soon as my wife stops the car in front of the house. Easily 15 feet and there's w
90.
▲
by
ambivalence
10y ago
I know you're joking but just for the record: this process was started in late 2015, it's a surprisingly complicated endeavour to switch source control hosting.
More ›