381-390¶
Issue #381 Face Detection, NumPy Drops Python 2, Async Frameworks, and More Aug. 13, 2019¶
Cite
Traditional Face Detection With Python
In this course on face detection with Python, you’ll learn about a historically important algorithm for object detection that can be successfully applied to finding the location of a human face within an image.
网课,传统人脸识别hhar啥的
Cite
print() Function Deep Dive (17,000 Words Guide)
Learn all there is to know about the print() function in Python and discover some of its lesser-known features. Avoid common mistakes, take your “hello world” to the next level, and know when to use a better alternative.
print函数的相关介绍,包括各种花里胡哨的print
Issue #382 Python Dev Environment Tips, Python at Scale, PyCon 2020, and More Aug. 20, 2019¶
Cite
Python Static Analysis at Scale: An Instagram Story
Instagram’s back-end is a massive Django app with several million lines of code. This post is about how they’ve used linting and automated refactoring to help manage the scale of their Python codebase.
Instagram Server is entirely Python powered.
Instagram的大型Python项目代码规范思路,好像是主要用了静态类型检查,以后可以再来学习一下
这个大兄弟预测到October 8, 2019的时候pypi的包将会超过200000个¶
十月十二号前来验证,预测失败
讨论了一手
Python中nolocal的用法 自己写一个例子 是这样的,如果你在一个函数写count=count+1,那么这个count默认是局部变量,但是没有定义count会导致找不到变量,所以写一个global count,这样表示这个count是全局变量,也就是第一行的那个count,上面那个程序直接结果是1 2 2。但是有的时候你可能想用第三行的那个,你就写nonlocal count,表示这个count不是一个局部变量,那么python就向外层找,就找到了第三行的count,上面执行的结果是1 2 0 那么很自然的就想这么写试一下 解释是,你写nonlocal 的意思就是,向外层找,但是你还不想要全局变量,所以就找不到。 综上,nonlocal的意思是向外层找还不要全局变量,所以可以想到,只有构造闭包的时候才会有可能用到nonlocal这个东西 综综上,估计这辈子都用不到了
他很喜欢Scala里面的Case Class,在Python里面实现了一个,看了一下觉得用Python本来就可以更优雅的解决。比如两个Class的=运算符完全可以通过魔方函数__eq__来实现,单独搞一个Case Class有点多余
Issue #383 CPython Deep Dive, Refactoring Functions, Python 2.x EOL, and More Aug. 27, 2019¶
Cite
Your Guide to the CPython Source Code
In this detailed Python tutorial, you’ll explore the CPython source code. By following this step-by-step walkthrough,
you’ll take a deep dive into how the CPython compiler works and how your Python code gets executed.
觉得讲的比较好,仔细读一下 Your Guide to the CPython Source Code
Cite
Refactoring Functions to Multiple Exit Points
“It’s sometimes claimed that not only should a function have a single entry point, but that it should also have a single exit. One could argue such from sense of mathematical purity. But unless you work in a programming language that combines mathematical purity with convenience […] that point seems moot to me.”
有人觉得,函数应该只有一个入口,只有一个出口 作者认为,函数里有多个return利大于弊 我觉得还是看个人写代码风格吧,都行,自己jio得没问题就行
Cite
Python 3 Readiness Update
This is an automated Python 3 support table for the most popular packages. 360 out of the 360 most downloaded packages on PyPI now support Python 3.
pypi上的最受欢迎的360个包都已经支持Python3了
Cite
Time to Shed Python 2
“Don’t constrict yourself, Python 2 slithers off into the sunset in 2020.”
别再用Python2了,eof了
一个非常有意思的东西,可以把python代码转换成一行。不允许用eval之类的,实现过程中用了很多trick,目前好像with,生成器等几个没有实现,已经写了一个编译器。可以看看里面在PyCon2016的演讲视频,作者详细的介绍了实现的思路,演讲也很精彩。
Python使人快乐 一些人分享自己用Python获得的效率提升和获得的幸福感 写脚本处理数据,自动化完成任务,查询预测周围哪里的汽油便宜 有了Python,生活好滋味
为什么Python没有取代JacaScript成为浏览器的主力脚本语言?
Cite
How the Gunicorn WSGI Server Works
An overview of how the Gunicorn WSGI HTTP server works internally.
就说了一下wsgi是啥玩意,没啥东西
增强版sqlite,增加了一点功能,更适合写密集型任务
创建Python项目的文档
单文件django项目,意义不明
Issue #384 Python 3.8 Final Beta, NLP With spaCy, Go vs Python, and More Sept. 3, 2019¶
Cite
CPython Release 3.8.0b4
This is the last beta before 3.8 RC1.
新版本,主要看了下海象符
Cite
Python Rounds Float Values by Converting Them to String and Then Back
Interesting CPython tidbit—apparently this really is a good way to implement floating point rounding in practice.
打不开
Cite
Python Decorator With Arguments
A simple example which explains how to create a decorator function that accepts and uses arguments.
带参数的装饰器
Issue #385 Python IEEE Ranking, Matlab vs Python, Type-Checking 4M LOC, and More¶
Cite
Python args and *kwargs: Demystified
In this step-by-step tutorial, you’ll learn how to use args and kwargs in Python to add more flexibility to your functions. You’ll also take a closer look at the single and double-asterisk unpacking operators, which you can use to unpack any iterable object in Python.
和*的用法
Cite
Absolute vs Relative Imports in Python
If you’ve worked on a Python project that has more than one file, chances are you’ve had to use an import statement before. In this course, you’ll not only cover the pros and cons of absolute and relative imports but also learn about the best practices for writing import statements.
看视频需要会员,会员一个月145,好鸡儿贵
Cite
Multiprocessing vs Threading in Python: What Every Data Scientist Needs to Know
Learn more about Python parallelization libraries (multiprocessing and threading) and understand which to use when for different data science problem sets.
没啥大用
没啥大用
wow,awesome
Issue #386 PyCon 2020 CFP, PEP 604 (frozenmap), Python vs C++, and More Sept. 17, 2019¶
Cite
Python vs C++: Selecting the Right Tool for the Job
Explore the similarities and differences you’ll find when comparing Python vs C++. You’ll learn about memory management, virtual machines, object-oriented programming differences, and much more.
Python和C++的各方面对比了一下
Cite
PEP 603: Adding a frozenmap Type to collections
A draft PEP that proposes adding a new fully persistent and immutable mapping type called frozenmap to the collections module in the Python standard library.
PYTHON.ORG
新增了一个frozenmap类型
Cite
What Are Some of the Drawbacks of Python?
Also see the related discussion on Hacker News.
QUORA.COM
一些Python的缺点,主要是Python2的
Cite
JPMorgan’s Athena Has 35 Million Lines of Python 2 Code, and Won’t Be Updated to Python 3 in Time
“With 35 million lines of Python code, the Athena trading platform is at the core of JPMorgan’s business operations. A late start to migrating to Python 3 could create a security risk.”
JAMES SANDERS
Python2代码太多,无法迁移
Cite
LEGB? Meet ICPO, Python’s Search Strategy for Attributes
How Python looks up object attributes like obj.name using a “instance, class, parent, object” search algorithm.
Python中寻找属性时候的查找顺序
Cite
Python heapq Module and Heap Data Structure Explained With Examples
MEENAKSHI AGARWAL
介绍了Python中heapq的几个用法
Cite
Fastest Python Function to Slugify a String
PETER BENGTSSON
几种不同的方法来去除字符串中的特殊字符的速度比较
Cite
awesome-python-typing: Python Type Stubs, Plugins, and Tools
GITHUB.COM/TYPEDDJANGO
Python中类型检测相关的文章、资源
Issue #387 Debugging Python With Pdb, Trusting PyPI, Requests Under New Ownership, and More Sept. 24, 2019¶
Cite
How Do You Verify That PyPI Can Be Trusted?
“A co-worker of mine attended a technical talk about how Go’s module mirror works and he asked me whether there was something there that Python should do.”
BRETT CANNON
如何提高PyPI的可靠性
Cite
Getting Started With Async Features in Python
Get the tools you need to start making asynchronous programming techniques a part of your repertoire. You’ll learn how to use Python async features to take advantage of IO processes and free up your CPU.
REAL PYTHON
异步编程
Cite
Gooey: Turn (Almost) Any Python CLI Program Into a Full GUI Application With One Line
GITHUB.COM/CHRISKIEHL
GUI
Cite
espresso: Fast End-To-End Neural Speech Recognition Toolkit
GITHUB.COM/FREEWYM
看起来像是Pytorch来搞语音识别的
Issue #388 Python Generators How-To, Python vs Java/Julia/Matlab/IDL, CPython 3.8 RC, and More Oct. 1, 2019¶
Python 3.8.0 release candidate 1发布
Issue #389 Python Code Formatters, Python 2.7 Retirement, PyPy Gets Faster, and More Oct. 8, 2019¶
Cite
Timsort: The Fastest Sorting Algorithm You’ve Never Heard Of
CPython uses Timsort for sorting containers. Timsort is a fast O(n log n) stable sorting algorithm built for the real world — not constructed in academia.
BRANDON SKERRITT
Python中的sort()使用的排序算法,中文版见https://sikasjc.github.io/2018/07/25/timsort/
Cite
(Floating Point) Numbers, They Lie
When and why 2 + 2 = 4.00000000000000000001…
GLYPH LEFKOWITZ
Python中的浮点数有点奇怪,>>>0.1+0.2 >>>0.30000000000004,是由于精度的问题,事实上Python也可以做到完全准确来表示分数,你可以使用内置的fractions模块,不过为了效率和精度的折衷方案,Python采取了现有的方案,作者最后安利了一下R语言,安利你妹
Cite
Python 2.7 Retirement Countdown: ~2.5 Months
PYTHONCLOCK.ORG
这位选手要退役了
Cite
What’s Your Favorite Python Library?
Twitter discussion about everyone’s best-loved Python libraries. What’s your personal favorite?
MIKE DRISCOLL
说“this”的大兄弟很有灵性 这官方来打广告可还行
Cite
How Dictionaries Are Implemented in CPython
Learn what hash tables are, why you would use them, and how they’re used to implement dictionaries in the most popular Python interpreter: CPython.
DATA-STRUCTURES-IN-PRACTICE.COM
很不错的一篇文章,介绍了Python中dict的具体实现方法 常见的实现dict的方法有搜索树和哈希表,比较起来,搜索树占用空间小,但是搜索速度较慢,哈希表搜索快但是浪费空间 (哈希表搜索平均O(1),最坏O(n),搜索树搜索总是O(logn),搜索树有多少数据存多少数据,但是哈希表要一开始就申请一个大数组) Python中实现是用哈希表。有俩数组,一个存索引也就是哈希值,一个存value和相关信息。存值时用SipHash函数(一种速度更快的哈希函数)来计算哈希值存入第一个数组,如果发生了碰撞就使用开放地址法解决冲突,新地址的计算不是线性的,比线性更好,具体是啥没细看,然后找到第二个数组中合适的位置存进去。当删除一个值的时候,只删除第二个数组中的值不删除第一个数组中的哈希值,因为如果把第一个数组中的值也删除,之前的由于碰撞而再哈希的数据会出问题。 当哈希表中的数据过多的时候,就新建一个新的哈希表然后把所有数据迁移过去,对于已经删除的数据不进行迁移
Cite
Using the Python zip() Function for Parallel Iteration
How to use Python’s built-in zip() function to solve common programming problems. You’ll learn how to traverse multiple iterables in parallel and create dictionaries with just a few lines of code.
REAL PYTHON
zip的用法
Issue #390 Python 3.8 Released + What's New, PyPI Crossed 200k Packages, and More Oct. 15, 2019¶
Cite
CPython 3.8.0 Released
Assignment expressions, positional-only arguments, = specifier in f-strings, and more. Click the link for the full changelog and download links.
PYTHON.ORG
喜大普奔
Cite
Cool New Features in Python 3.8
What does Python 3.8 bring to the table? Learn about some of the biggest changes and see you how you can best make use of them.
REAL PYTHON
海象表达式 type hint的三个pep
Cite
PyPI Just Crossed the 200,000 Packages Threshold! 🥳
TWITTER.COM/REALPYTHON
耶