HNHacker News
TopNewBestAskShowJobs

ambivalence

848 karma · joined April 30, 2009

Łukasz Langa. Python guy at Meta. Previously, CPython Developer in Residence. Python 3.8 and 3.9 release manager. Creator of Black, an opinionated code formatter.

Contact information in the KeyBase link below.

[ my public key: https://keybase.io/ambv; my proof: https://keybase.io/ambv/sigs/YFlWGlv21O-p2KBCGkahQq5QvzaW2fYVzzXGYMEreM8 ]

$2a$11$70w6J.UbVsGwuTMIvSTq5Oh97csRvkT9bz2BuWASdYI1W4MhnMDU2

submissionscomments
ambivalence··on Silicon Valley Has an Empathy Vacuum
> The streets of San Francisco—spiritually part of the Valley—feel less crowded. Coffee-shop conversations are hushed. Everything feels a little muted, an eerie quiet broken by chants of protesters. It even seems as if there are more parking spots.

Or maybe it was just Thanksgiving week?

ambivalence··on A Rebuttal for Python 3
See, this is a good example because in Python 2 the string is just bytes. Ł is 0xC5 0x81. Reversing those bytes just corrupts the content. This isn't exclusive to this one operation. Let me give you another example:

  >>> print "Hi, my name is Łukasz Langa.".lower()
  hi, my name is Łukasz langa.
Whereas on Python 3:

  >>> "Hi, my name is Łukasz Langa.".lower()
  'hi, my name is łukasz langa.'
Or even more basically, Python 2:

  >>> len("Hi, my name is Łukasz Langa.")
  29
Python 3:

  >>> len("Hi, my name is Łukasz Langa.")
  28
Sure, there's hard things about code points and graphemes that Python 3 also doesn't touch, like the example you gave (originally: characters outside of the BMP using surrogate pairs, later: using combining characters), or equality (where normalization might be needed to compare two strings that look alike), or sorting (where collation rules mean the same code points might sort differently depending on the language used). But there's tools to deal with those tricky situations and the default is much more robust.

And sure, you can use the `unicode()` type in Python 2 to get the correct results but the problem is that most APIs will work with both types and silently do the wrong thing every now and then. Those include UnicodeDecodeErrors and UnicodeEncodeErrors that you get sometimes. In Python 3, without the magic type promotion, you'll get a sane TypeError every time.

Disclaimer: the name used in the example is mine.

ambivalence··on The Case Against Python 3
Thank you!
ambivalence··on Google reverses its ‘digital death sentence’ for Pixel phone resellers
I use it as a primary search engine on all devices. Every now and then I'd fallback to !g or !gi if a particular search is particularly bad, typically to learn that Google isn't much better. But the fact those commands are there makes it super low friction :)
ambivalence··on Be careful about what you dislike
__future__ imports are per file. A few posts up you were proposing an interpreter-wide switch. Did you change your mind?
ambivalence··on Keep Ruby Weird Again [video]
Well, we'd believe you if you said "Nobody has more respect for Hacker News than me. I know it, you know it, everybody knows it!"
ambivalence··on Python JITs are coming
You ask for it, you got it!

https://morepypy.blogspot.com/2016/08/pypy-gets-funding-from...

ambivalence··on How I Cracked a Keylogger and Ended Up in Someone's Inbox
Watch out. You laugh at this as if it's some Marvel Universe pop culture thing. In fact, some of the readers here have families that were sent to Siberia during or shortly after WW2. You wouldn't joke about concentration camps. I hope.
ambivalence··on Is the Great Attractor a Tengen Toppa Gurren Lagann?
Do you think if you submitted an RTF or even a TXT they would turn you down?
ambivalence··on Tip your Uber driver
An European's perspective on tipping is nicely covered here: https://www.youtube.com/watch?v=vBTfj2lN6sQ

Basically, "The bill came to $20 therefore you asked me for $20 and as per your exact request I gave you $20. Just like you asked. And I'm somehow an asshole for that."

Yes, he also covers "waiters are underpaid", etc.

ambivalence··on Show HN: A Chrome extension to remind you why you opened Facebook
One more trick for you: use messenger.com if you need contact with people at work but don't want notifications or the news feed to distract you.
ambivalence··on Julie Rubicon
You can always just say:

"Read the article FIRST and then come back to read the comments. . . . Spoiler alert. Post is fiction. Yadda yadda."

ambivalence··on Show HN: AppApp.io – A better search for the iOS App Store
You could make it usable as a "web clip", i.e. an bookmark that you can add to your home screen.
ambivalence··on Show HN: AppApp.io – A better search for the iOS App Store
A whole world of new search vectors would open if you scraped and mined the reviews.
ambivalence··on Show HN: AppApp.io – A better search for the iOS App Store
This is a nice alternative. Bookmarked! As I'm sure you know as a parent by now, the next nice-to-have feature would be to filter against apps that use ads. Worst offenders being full screen video ads you can't skip and banner ads placed close to buttons.

Children are quite vulnerable to believe what they're seeing in the ad verbatim. Then you're the bad guy for not agreeing to get them that game they just saw beeing so great. More importantly though, brainwashing with ads steals the time that was supposed to be spent on something else.

At least your "No IAP" filter already eliminates the awful apps that let children "earn coins" for watching ads.

ambivalence··on What’s New in Python 3.5
Well, there's also type hints that so far we haven't added to "What's New" :)

https://www.python.org/dev/peps/pep-0484/

ambivalence··on Sense – Wake up when it's right for you
Where's the bundle with the "Keep-My-5yo-Kid-Asleep-Until-My-Alarm-Goes-Off" option? Would pay for that.
ambivalence··on The Meaning of Life
Derek Sivers is so wrong in his video.

The Talking Heads were active until 1991!

ambivalence··on Moves joins Facebook
How do you mean "All your WhatsApp messages"? Isn't it by design that WhatsApp only ever stores undelivered messages? Once they reach the recipient, they're gone from the servers. This lets the infrastructure be really small compared to the number of users on the system.
ambivalence··on Space Colony Art from the 1970s
The torus design really makes it so that it's uphill both ways. That would change the "Back in my day" jokes forever.
ambivalence··on Meanwhile, at code.org
You surely shared this so I can weigh in. No? Not really? Well, here's my opinion anyway. In this infographic Bret Victor claims that expecting college education to prepare you for a day job is an invalid idea. He also implies that an opinion of an MIT mathematician is inherently more trustworthy and correct than opinions of dozens of business leaders, politicians, educators, astronauts, and, oh, Stephen Hawking (“Whether you want to uncover the secrets of the universe, or you just want to pursue a career in the 21st century, basic computer programming is an essential skill to learn.“). Oh, you missed that in his infographic? It's probably because it conveniently wasn't there. Check out the full list at http://code.org/quotes

But really, is it fair to compare a long, structured statement with brief quotes that are meant to be an effective marketing tool? Before you cringe at the dirty m-word, consider what is being marketed here. Kids now learn creationism, liberal arts, and opinionated history at school. Coding is a refreshingly logical, concrete and objective field of study. It's worth getting it to the 90% of high schools that don't teach it yet, even if it ends up being trivial if-then-else turtle-make-30-steps-forward. We're at a time where it's more about simply getting the foot in the door.

Then again, it's easier to fire up Illustrator and call bullshit on an initiative to bring more rational education to the curriculum. This is the depth of thought that powers elitism and the status quo. Snarky infographics that suggest that programming is worthless without tying it to specific so called Powerful Ideas are harmful. Even if they're drawn by a world-class designer and electrical engineer. Or maybe especially then.

ambivalence··on The Python Paradox is now the Scala Paradox
The Python community, being relatively small, seems to dig this aggressive way of making changes to libraries and the interpreter itself. It has many advantages and speaking of disdvantages, most of the ones you specify are really non-issues.

I mean, you're not forced to use the newest version of the interpreter. You're not forced to use the newest version of any library. Moreover, you're not forced to use a single specific version of the interpreter on a machine. And with the use of virtualenv or buildout, you won't complain that your application used to work, and it doesn't, because the environment evolved.

And if you're "scpying directories" between servers, relying on whatever version of the interpreter you find, you're doing it wrong.

← PreviousPage 4 of 4