蠎加载 177
原文: Import Python Weekly Newsletter - Issue No 177 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… Python 惯用: Multiline Strings core-python I rarely see Multiline strings used in Python code outside of docstrings, but they can be very useful, especially when you need to create a very specifically structured string, like a code snippet, help section to print to the screen or ASCII art for a snake. The problem is that it’s just ugly, because indenting the strings actually inserts the indentation into the string. (是也乎: 这个形式什么都好, 就是一嵌套就乱了… ) PEP 572 和 decision-making in Python BDFL The “PEP 572 mess” was the topic of a 2018 Python Language Summit session led by benevolent dictator for life (BDFL) Guido van Rossum. PEP 572 seeks to add assignment expressions (or “inline assignments”) to the language, but it has seen a prolonged discussion over multiple huge threads on the python-dev mailing list—even after multiple rounds on python-ideas. Those threads were often contentious and were clearly voluminous to the point where many probably just tuned them out. At the summit, Van Rossum gave an overview of the feature proposal, which he seems inclined toward accepting, but he also wanted to discuss how to avoid this kind of thread explosion in the future. (是也乎: BDFL 说了算 ) 直想要可视化 Python 调试器由 Jupyter notebook 赋予 jupyter Some would rightfully point out that Jupyter already supports pdb for simple debugging, where you can manually and sequentially enter commands to do things like inspect variables, set breakpoints, etc.?—?and this is probably sufficient when it comes to debugging simple analytics. To raise the bar, the PixieDust team is happy to introduce the first (to the best of our knowledge) visual Python debugger for Jupyter Notebooks. (是也乎: Jupyter 的潜力刚刚开始嗯哼 ) BuzzFeed 如何将微服务从 Perl Monolith 迁移到 Go 和 Python migration BuzzFeed have recently migrated from a monolithic Perl application to a set of around 500 microservices written in a mixture of Python and Go. (是也乎: 从 perl 到 go+py… ) Python 中常见10种安全漏洞,以及如何避免它们 security Here are my top 10, in no particular order, common gotchas in Python applications. (是也乎: avoid 是重点 ) 嗯哼 Python 中 lambda 表达式的异常 codesnippets The following piece of code can certainly claim being the most insane Python expression ever written. (是也乎: 其实,所以,因为,那么… ) Python Cheatsheet cheatsheet Anyone can forget how to make character classes for a regex, slice a list or do a for loop. This cheatsheet tries to provide a basic reference for beginner and advanced developers, lower the entry barrier for newcomers and help veterans refresh the old tricks. (是也乎: 每个大版本发布后, 都得对应嗯哼一下 ) Decorators core-python Learn Python Decorators in this tutorial. (是也乎: 叕一则内建功能的教程 ) GCP(Google Cloud Platform)上 Apache Beam 的 Python 开发环境 apache beam These instructions will show you how to set up a development environment for Python Dataflow jobs. By the end you’ll be able to run a Dataflow job locally in debug mode, and execute code in a REPL to speed your development cycles. (是也乎: Dataflow 任务? ) Python 的类型提示状态 core-python One of the main selling points for Python is that it is dynamically-typed. There is no plan to change this. Nevertheless, in September 2014 Guido van Rossum (Python BDFL) created a python enhancement proposal (PEP-484) to add type hints to Python. It has been released for general usage a year later, in September 2015, as part of Python 3.5.0. Twenty-five years into its existence now there was a standard way to add type information to Python code. In this blog post, I’ll explore how the system matured, how you can use it and what’s next for type hints. (是也乎: 反正老爹说了算 ) Vibora - Python Web 框架/服务器 webframework Vibora APIs were heavily inspired by the awesome Flask. Builtin features were also based on many famous libraries as jinja2, marshmallow, websockets by aaugustin, werkzeug and many others. (是也乎: Py3.6+ only… ) 理解任意一头 Python 程序猿 – Notes By A Nerd fairseq pytorch Fairseq(-py) is a sequence modeling toolkit that allows researchers and developers to train custom models for translation, summarization, language modeling and other text generation tasks. It provides reference implementations of various sequence-to-sequence models, including: (是也乎: sequence-to-sequence 模型的 pytorch 嗯哼 ) 好物 ~ 包/模块/库/片段… ...