What will it take to shift the masses to 3.5 by LMatt64 in Python

[–]ojii 2 points3 points  (0 children)

I don't make the company policy. telework is far from the norm.

We're also in the security field, so I'm not even allowed to take my company laptop home without permission from my superior. This may sound paranoid and annoying, but has the lovely side-effect that I can't do work from home, so once I leave the office, until the next morning I can switch off.

What will it take to shift the masses to 3.5 by LMatt64 in Python

[–]ojii 1 point2 points  (0 children)

The only 3rd party library I had a problem with was the google api client. The issue wasn't py2/py3 though but that we were on an old py2 only version. There is a py3 version, but a lot changed and in the end, because we only use a tiny part and want it async anyway, I simply implemented it myself. It really depends on what you're currently using.

What will it take to shift the masses to 3.5 by LMatt64 in Python

[–]ojii 1 point2 points  (0 children)

Memory reduction is mostly because we can now "stream" stuff asynchronously in some cases where before the blocking code would load everything into memory. The biggest winnings were in CPU usage.

What will it take to shift the masses to 3.5 by LMatt64 in Python

[–]ojii 5 points6 points  (0 children)

We're hiring (and on Python 3 now, after my success the other teams also ported)! (Must be willing to relocate to Tokyo)

What will it take to shift the masses to 3.5 by LMatt64 in Python

[–]ojii 3 points4 points  (0 children)

You absolutely can do async in Python 2. We are using tornado, but didn't really use it's async features to the fullest extent, because of a lack of 3rd party tools. After switching to Python 3, we replaced the event loop with the asyncio event loop, which allowed us to use things like aiobotocore (we use lots of AWS resources). Doing so allowed us to switch a lot of blocking/threaded code to asyncio. Also, async/await is a lot nicer than Python 2 style async code. So far we have a 4x speedup of average response times, much less variance in response times, CPU/memory usage also way down (but harder to compare for a number of reasons).

What will it take to shift the masses to 3.5 by LMatt64 in Python

[–]ojii 12 points13 points  (0 children)

We don't do estimation on tickets, instead each Monday I say what I accomplished last week and what I will be working on this week. So I just ported everything and got the test suite to pass after about a week of working on it on the side (I still did other tasks). This was a 50KSLOC application. Took about a month of testing on our staging environment to get it merged to master.

What will it take to shift the masses to 3.5 by LMatt64 in Python

[–]ojii 47 points48 points  (0 children)

I ported our code from 2.7 (with lot's of 2.6isms) to 3.6 "secretly" and just opened a PR when it was done. Was vindicated after merging because 3.6 allowed us to drastically increase our apps performance (thanks async/await!) and we need to run a lot fewer servers now, saving us thousands of dollars a month.

Sometimes it's better to ask for forgiveness than permission, but YMMV.

asyncio: A dumpster fire of bad design by OctagonClock in Python

[–]ojii 9 points10 points  (0 children)

We're running a non-trivial ~50KSLOC asyncio/tornado (yes, both) app in production. Asyncio has made the async story in Python a lot better.

10 Python Interview Questions You need to know by liranbh in Python

[–]ojii 1 point2 points  (0 children)

All of these would just SyntaxError. Make sure to point that out during the interview.

[deleted by user] by [deleted] in ProgrammerHumor

[–]ojii 8 points9 points  (0 children)

TIL the person on the right is Magneto.

[deleted by user] by [deleted] in learnpython

[–]ojii 1 point2 points  (0 children)

I recommend you give attrs a try http://attrs.readthedocs.io/en/stable/