机器狗已在公开发售,支持用 Python 对其编程...

原文: PyCoder's Weekly - Issue #427

pycoder

  • 200701 Zoom.Quiet(大妈) 用时 42 分钟 完成快译
  • 200701 Zoom.Quiet(大妈) 用时 37 分钟 完成格式转抄.

This PEP proposes adding pattern matching—a sort of enhanced switch statement—to the Python language. Read the PEP at the link above and follow the discussion on Reddit.

(是也乎:

def is_tuple(node: Node) -> bool:
    match node:
        case Node(children=[LParen(), RParen()]):
            return True
        case Node(children=[Leaf(value="("), Node(), Leaf(value=")")]):
            return True
        case _:
            return False

这非常 Elixir 了.

)

One of the advantages Python has over a language like C is that you don’t have to worry about how memeory is freed up during program execution. But sometimes Python’s memory management doesn’t work the way you’d expect.

In this step-by-step tutorial, you’ll learn how Python’s reduce() works and how to use it effectively in your programs. You’ll also learn some more modern, efficient, and Pythonic ways to gently replace reduce() in your programs.

(是也乎:

reduce...

用 eomji 来解释...

reduce

)

What makes Python… Python? Is it the language semantics? A set of features? What could you strip away and still have something you’d call Python? Everyone needs a little programming language existentialism now and then.

(是也乎:

RustPython

这 logo 也忒萌了吧...

)

There’s an implementation of PEP 622 that you can try out here. But it has some potentially confusing effects.

It only took 28 year, but now you can have your very own robot dog. If you can stomach the price tag, that is. But hey, it’s got a Python SDK!

(是也乎:

Boston

嗯哼?大众也可以拥有军事级机械人了?

)

Is that a corgi or a goldfish?

讨论

Discussions

Considering issues like floating-point representation error, is it ever a good idea to use a float as an index?

Is it, though? The square root of 2 might not be a good value for timing comparisons.

文章,教程和嗯哼

Articles, Tutorials and Talks

Explore the heap and priority queue data structures. You’ll learn what kinds of problems heaps and priority queues are useful for and how you can use the Python heapq module to solve them.

(是也乎:

heapq

)

The lru_cache decorator allows you to take advantage of memoization to optimize function calls.

In this course, you’ll get a Python-centric introduction to character encodings and Unicode. Handling character encodings and numbering systems can at times seem painful and complicated, but this guide is here to help with easy-to-follow Python examples.

(是也乎:

Unicode

用无线电载波来形容 Unicode 流程, 好赞.

)

Author Victor Stinner argues that Python’s C API is too close to the CPython implementation, which limits available optimizations and hinders the addition of new features. PEP 622 proposes hiding implementation details from the C API.

Have you wanted to learn Regular Expressions in Python, but don’t know where to start? Have you stumbled into the dreaded pink SettingWithCopyWarning in Pandas? Then check out this episode of the Real Python Podcast.

(是也乎:

podcast

)

The Dependency Inversion Principle helps you design code that is more extensible and easier to test. You can use it to test code that makes HTTP requests without using mocks.

(是也乎:

随着微服务的扩张, RPC 盛大回归, 基于 HTTP 的请求越来越少的了...

)

Red Hat explains how they compiled CPython with GCC’s -fno-semantic-interposition flag to get run time speed improvements up to 30% faster than normal.

Should you use mutable objects for default function arguments? Conventional wisdom says no, but has the risk been overstated?

Learn how to use OpenCV to detect street lanes in an image of a road.

好物

Interesting Projects, Tools and Libraries, Projects & Code

(是也乎:

好久没见这位的消息了, 还活着, 甚好.

)

(是也乎:

NLP 相关项目越来越多, 说明 AI 落地首先是这个方向?

)

(是也乎:

嗯哼, 很少见的小语种 NLP 模块哪... 目测是国家项目? )

(是也乎:

这个可以有, 通过Py 就可以和远程主机进行 剪贴板 自动同步操作了?

)

(是也乎:

反正 Python 从内核就设计的异常亲 C, 所以, 各种 C++ 的模块进行包装很自然. )

📆🐍 活动/大会

Events, MeetUp 真的是全球线下活动组织中心

(是也乎:

中国也已经接到有关通知, 允许线下集会申报了...

而且今年程序员节(10.24)可能有超级大会.

)

DAMA

❤️ Happy Pythonic ;-(大妈私人无责任播报)

101camp10py 开始报名

报名

课程规划:
    报名截止 2020.7.20
    正式开课 2020.7.26
    课程结束 2020.9.06

详情 => 蟒营™ Python 入门班第10期

提醒: 首周报名再优惠 420 元.

PS:


NN 4061

好文笔,感叹号年度配额: 1/3

投稿/反馈邮箱:

askdama@googlegroups.com

(邮件列表地址, 当成正常邮件发送邮件就好, 不用注册, 不用翻越...)


ZoomQuiet/大妈

就是四处 是也乎,( ̄▽ ̄) 的那个大妈:

私自嗯哼: ZoomQuiet (订阅号: ZoomQuiet42)
公开课程: 蟒营 (订阅号: Mainium)
历史吐糟: Chaos42 (订阅号 PythoniCamp)

as 创始组织者:
    PyChina (订阅号: PyChinaOrg)
    本地社区: 
        GDG珠海 (订阅号: GDG-ZhuHai)
        TFUG珠海 (订阅号: ZH_TFUG)

RPP


Comments


大妈的多重宇宙 - YouTube

全新自媒体系列...科学幻想,读书,说故事...

任何问题

随时邮件提问可也:
askdama@googlegroups.com

-->