原文: Import Python Weekly Newsletter - Issue No 171 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程…
最好的 Python:从2017年到2018年收藏的一系列文章(到目前为止) 2017, python articles In this article, I’d like to share with you the articles I found most interesting and insightful (inspiring) last year and this year (so far). My other goal was to create a comprehensive list of the most valuable pieces for my Python students. (是也乎: 老司机的私人体验, 应该就是 Py 自身真正的好物了… ) Python 3.7: 介绍数据类 pycharm, data classes Python 3.7 is set to be released this summer, let’s have a sneak peek at some of the new features! If you’d like to play along at home with PyCharm, make sure you get PyCharm 2018.1 (or later if you’re reading this from the future). There are many new things in Python 3.7: various character set improvements, postponed evaluation of annotations, and more. One of the most exciting new features is support for the dataclass decorator. (是也乎: 怀疑哪, Py3 这么多激荡的变化, 是否有 IDE 厂商的嗯哼? ) Qt 让 Python 令计算贴近你 - Qt Blog pyside PySide2 – the bindings from Python to Qt – changes skin this spring. We have re-branded it as Qt for Python on a solution level, as we wanted the name to reflect the use of Qt in Python applications. Under the hood it is still PySide2 – just better. (是也乎: Qt 开源后走的一直不错, 只是太慢, 就连 IDE 都一直非常不嗯哼…这种广告都没有 subl 来的多…可想… ) 转换 Python ASTs 来优化 AST tl;dr Python comprehensions can have duplicate function calls (e.g. [foo(x) for x in … if foo(x)]). If these function calls are expensive, we need to rewrite our comprehensions to avoid the cost of calling them multiple times. In this post, we solve this by writing a decorator that converts a function in to AST, optimizes away duplicate function calls and compiles it at runtime in ~200 lines of code. (是也乎: 不过,这种机械优化, 永远没有人工介入后, 经验加成的效果好… ) Cgo 和 Python go, cpython If you look at the new Datadog Agent, you might notice most of the codebase is written in Go, although the checks we use to gather metrics are still written in Python. This is possible because the Datadog Agent, a regular Go binary, embeds a CPython interpreter that can be called whenever it needs to execute Python code. This process can be made transparent using an abstraction layer so that you can still write idiomatic Go code even when there’s Python running under the hood. (是也乎: 通过 C , go 和 python 一直灵魂相通的… ) 用 Python 进行机器学习的一些基本技巧和窍门 machine learning We describe some essential hacks and tricks for practicing machine learning with Python. 在 Kubernetes 中部署深度学习 GPU 运算模型 deep learning, GPU In this tutorial, we provide step-by-step instructions to go from loading a pre-trained Convolutional Neural Network model to creating a containerized web application that is hosted on Kubernetes cluster with GPUs on Azure Container Service (AKS). AKS makes it quick and easy to deploy and manage containerized applications without much expertise in managing Kubernetes environment. It eliminates complexity and operational overhead of maintaining the cluster by provisioning, upgrading, and scaling resources on demand, without taking the applications offline. AKS reduces the cost and complexity of using a Kubernetes cluster by managing the master nodes for which the user does no incur a cost. (是也乎: 这类工具一定会越来越方便的, 问题在 GPU 本身是硬件, 有固定成本, 这就是门槛了… ) Python 3 cheatsheet cheatsheet (是也乎: 叕一则作弊条…但是, 最靠谱的还是多用… ) Python 3 到 ES6 Javascript 转译器 js (是也乎: 没毛病, 问题只是, 这种转换的使用场景在哪儿? ) 用 PySpark 进行单元测试 – CambridgeSpark testing I don’t particularly enjoy writing tests, but having a proper testing suite is one of the fundamental building blocks that differentiate hacking from software engineering. Sort of like sending your application to the gym, if you do it right, it might not be a pleasant experience, but you’ll reap the benefits continuously. At work we are especially big fans of the testing pyramid, and having dozens of unit tests give us the support that we need to deliver high quality software with rapid delivery to production. (是也乎: 叕一个单元测试框架, ) 好物 ~ 包/模块/库/片段…
...