为什么 Python 如此神奇

原文: PyCoder's Weekly - Issue #590

pycoder

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

In this tutorial, you’ll learn how to use the Self type hint in Python to annotate methods that return an instance of their own class. You’ll gain hands-on experience with type hints and annotations of methods that return an instance of their class, making your code more readable and maintainable.

(是也乎:

self )

Objects with enter and exit methods can be used as context managers in Python. This article (and screencast) explains most of what you’ll want to know when creating your own context managers.

This PEP proposes a metadata format which a single-file script can use to specify dependency and tool information for IDEs and external development tools. It replaces PEP 722.


探讨/吐糟

Discussions

NULL


文章/教程/嗯哼

Articles, Tutorials and Talks

Learn prompt engineering techniques with a practical, real-world project to get better results from large language models. This tutorial covers zero-shot and few-shot prompting, delimiters, numbered steps, role prompts, chain-of-thought prompting, and more. Improve your LLM-assisted projects today.

(是也乎:

Prompt

)

An extremely detailed, deep dive on how static type systems impact the consistency of languages. Hirrolot compares a variety of lesser known languages to see the consequences of their decisions. See also the associated Hacker News discussion.

(是也乎:

都是硬件的锅...

)

In this tutorial, you’ll dive deep into Python’s lists. You’ll learn how to create them, update their content, populate and grow them, and more. Along the way, you’ll code practical examples that will help you strengthen your skills with this fundamental data type in Python.

(是也乎:

list

)

An comprehensive comparison on the performance of 9 major Sorting Algorithms and how well they perform under varying circumstances. The aim of the article is to show you where each type of Algorithms shines, and where it does badly.

(是也乎:

其实排序算法远没有到达极限, 谁要提出一个有效的排序算法照样能得图灵奖.

)

If you’re using Markdown on your blog, or any website, a conversion pipeline allows you to create your own rules and widgets. This article shows you how to integrate Bootstrap Alert boxes into a Markdown workflow.

This article shows a sample module that swaps the values for 8 and 9, not something generally recommended. Learn how side effects from an import can impact your code and just what the integer object cache is.

In this article, the author explains why he thinks that elegance should be a fundamental driver when you are writing (Python) code, and gives a few tips on how to write elegant code.

(是也乎:

>>> import itertools
>>> list_of_lists = [[1, 2, 3], [4], [5, 6]]
>>> list(itertools.chain(*list_of_lists))
[1, 2, 3, 4, 5, 6]

官方的优雅是必须的...

)

This opinion piece by Jos is a counter to the “its a terrible language” posts you come across once and a while. Read why Jos thinks Python is amazing.

(是也乎:

简单的说, 你可以用很低的心智成本作出任何东西来...

)

This blog post provides step by step instructions on how to implement llama from scratch, using a dramatically scaled-down version for training.

Deep CS paper on how to abuse Large Language Models and work around restrictions where the model is refusing to answer.

The annual report from the Python Software Foundation details all the changes and events at the PSF last year.

(是也乎:

grabt

怪不得无感呢...

)


好物/妙品/...

Interesting Projects, Tools and Libraries, Projects & Code

(是也乎:

dpv

)

(是也乎:

BeeWare 的衍生工具...

)


📆🐍 活动/大会

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


历史上这周


DAMA

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

      _~-+∽~_
  () /  ◵ ^  \ \/
    '_   △   _'
    > '--.--' |

...act by ferris-actor v0.2.4 (built on 23.0303.201916)

PS:

Happy Pythoning!

Copyright © 2023 PyCoder’s Weekly, All rights reserved.

PPS:

不觉中蟒周刊快译已经到了第10+2个年头

开始有小伙伴加入承担 pythonisa 周刊的翻译, 从来没提醒过, 可就这么默默坚持下来了...

问为什么:

[皱眉]每周新闻资讯 怎么能错过 
看看有什么新东西 
当有新的发现时:
    what f**k 还能这样玩? 还有这东西?
    每周开彩蛋[吃瓜]

无法同意更多... 很多社区贡献看起来辛苦, 其实受益最多的, 就是主动承担者也.

所以++> 锈周刊 -> Weekly :: China


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

投稿/反馈邮箱:

askdama@googlegroups.com

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


ZoomQuiet/大妈

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

全职嗯哼: 大妈的多重宇宙 - https://www.youtube.com/@Chaos42DAMA
私自嗯哼: ZoomQuiet (订阅号: ZoomQuiet42)
公开社群: 蟒营 (订阅号: Mainium)

as 创始组织者:
    CPyUG (mailling-list: python-cn@googlegroups.com)
    PyChina (订阅号: PyChinaOrg)
    本地社区: 
        GDG珠海 (订阅号: GDG-ZhuHai)
        AIGC珠海 


Comments


大妈的多重宇宙 - YouTube

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

任何问题

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

-->