Issue #511

typing.Protocol, args and kwargs, CPython 3.11.0a5 Released, and More

Feb. 8, 2022

typing.Protocol, args and kwargs, CPython 3.11.0a5 Released, and More
#511 – FEBRUARY 8, 2022 VIEW IN BROWSER
The PyCoder’s Weekly Logo
Defining Python Functions With Optional Arguments
Learn about Python optional arguments and how to define functions with default values. You’ll also see how to create functions that accept any number of arguments using *args and **kwargs.
REAL PYTHON course

typing.Protocol Across Python Versions
How to seamlessly support typing.Protocol on Python versions older and newer than 3.8. At the same time.
HYNEK SCHLAWACK

How to Quickly Label Data for Machine Learning
With Toloka, you can control the accuracy and speed of data labeling to develop high performing ML models. Our platform supports annotation for image classification, semantic segmentation, object detection, named entity recognition, sentiment analysis, speech recognition, text classification →
TOLOKA AIsponsor

A Better Pygame Main Loop
Improving your game’s main loop for smoother gameplay that takes less battery power: “Now your players’ laptops run cool while playing, and the graphics don’t have ugly tearing artifacts any more!”
GLYPH LEFKOWITZ

GitHub Survey on Languages and More Developer Things
JavaScript retains the top spot, Python keeps 2nd place gained in 2019 over Java, which holds in 3rd. Typescript continues 4th after racing up from 2017 from 10th to 4th in 2020. JavaScript + TypeScript seem to put that way ahead in terms of amount of code on GitHub.
GITHUB.COM • Shared by Ian Currie

Python News: What’s New From January 2022?
In January 2022, Black came out of Beta, IPython 8.0 was released, PEP 665 was rejected, and last but not least, a fifteen-year-old bug was fixed. In this article, you’ll get the details on these important happenings in the world of Python.
REAL PYTHON

Python in Visual Studio Code – February 2022 Release
This release includes: smart selection, folding support, improvements to the Python interpreters list, improvements when using Anaconda.
MICROSOFT.COM

CPython 3.11.0a5 Is Available
“We needed to tame some angry buildbots, but after a small fight, we won with just some scratches! Here you have a shiny new alpha release: Python 3.11.0a5.”
CPYTHON DEV BLOG


Discussions


Python Core Dev Says “It’s Now Time to Deprecate the Stdlib urllib Module”
“I propose to deprecate the urllib module in Python 3.11. It would emit a DeprecationWarning which warn users, so users should consider better alternatives like urllib3 or httpx: well known modules, better maintained, more secure, support HTTP/2 (httpx), etc.”
TWITTER.COM/VICTORSTINNER

Python’s IDLE Editor Is Much Better Now
“People used to say all kinds of things about Python’s native IDLE editor, but lately it has become a viable alternative for me to other editors like Notepad++.”
HACKER NEWS


Python Jobs


Python Software Engineer
FLASHPOINT 📍 ANYWHERE

Mid/Senior Django Developer
TYPE/CODE 📍 BROOKLYN, NY, USA

Sr Python Engineer
FLASHPOINT 📍 ANYWHERE

Senior Backend Engineer Django
DATAPANE 📍 UK, EUROPE

Backend Software Engineer
CATALPA INTERNATIONAL 📍 ASIA PACIFIC REGION

Senior Full-Stack Web Developer
MONETIZEMORE 📍 ANYWHERE

Python Engineer (Web Scraping)
NEWSCATCHER 📍 ASIA, TX, AMERICA

Python Trainer
PHYSIKALISCH-TECHNISCHE BUNDESANSTALT 📍 JAKARTA, INDONESIA

More Python Jobs >>>


Articles & Tutorials


Manipulating and Analyzing Audio in Python
Would you like to experiment with analyzing or manipulating audio with Python? This week on the show, we have Braden Riggs from DolbyIO to discuss extracting audio features and Python libraries for reshaping audio. Braden shares techniques from his recent talk at PyData Global, “Unlocking More From Your Audio Data!”
REAL PYTHON podcast

Creating Beautiful Tracebacks with Python’s Exception Hooks
“We all spend a good chunk of our time debugging, sifting through logs, or reading tracebacks. Each of these can be difficult and time-consuming and in this article, we will focus on making the last one—dealing with tracebacks and exceptions—as easy and efficient as possible.”
MARTIN HEINZ • Shared by Martin Heinz

Do You Know if Your Users Toggled Off Notifications
Clubhouse case study: you’ll remember they were the most downloaded app in APR of 2021. If you recall they spammed users with notifications. Most were irrelevant. Had they had a centralized notification system with a sophisticated preferences module the mass exodus likely could have been avoided →
COURIERsponsor

The Correct Way to Overload Functions In Python
“Function overloading is a common programming pattern which seems to be reserved to statically-typed, compiled languages. Yet there’s an easy way to implement it in Python with help of multimethods or, as it’s called in Python, Multiple Dispatch.”
MARTIN HEINZ

Only Python: Friendly-Traceback: Trying to Stay Ahead of IPython
“I’m writing this blog post in the hope that some people will be encouraged to test friendly/friendly-traceback with IPython/Jupyter and make suggestions as to how it could be even more useful.”
ANDRÉ ROBERGE

Python’s len() Function
Learn how to find the length of built-in data types using len(), use len() with third-party data types, and provide support for len() with user-defined classes.
REAL PYTHON course

Variance of Generic Types in Python
Explaining generics that are—covariant, contravariant or invariant in types, and why it matters while working with type annotations in Python.
REDOWAN DELOWAR • Shared by Redowan Delowar

Join The Big Fix - Fix Vulnerabilities. Earn Swag.
Earn swag (including t-shirts) for fixing vulnerabilities! Plus, join our fix-a-thon livestream on Feb 25.
SNYK.IOsponsor

Working With Static and Media Files in Django
A look at how to work with static and media files in a Django project, locally and in production.
AMAL SHAJI • Shared by Amal Shaji

Natural Language Processing for Icelandic With PyPy: A Case Study
VILHJÁLMUR ÞORSTEINSSON

Different Approaches for Inverting Binary Tree in Python
MISHA BEHERSKY • Shared by Misha Behersky


Projects & Code


Brought to you by Real Python for Teamssponsor
Online Python training created by a community of experts. Give your team the real-world Python skills they need to succeed →

BeeWare: Write Python, Run Everywhere Using Native UIs
BEEWARE.ORG

sqladmin: SQLAlchemy Admin for Starlette/FastAPI
GITHUB.COM/AMINALAEE • Shared by Amin Alaee

etna: Python Module for Time Series Forecasting
GITHUB.COM/TINKOFF-AI • Shared by Andrey

ChemicalX: Deep Learning Library for Drug Pair Scoring
GITHUB.COM/ASTRAZENECA • Shared by Benedek Rozemberczki

GraphWrap: Add GraphQL Interface to DRF Apps
GITHUB.COM/PAULGILMARTIN • Shared by Paul Gilmartin

strongtyping-pyoverload: A Runtime Method Overload Decorator
PYPI.ORG

📆🐍 Upcoming Python Events


Weekly Real Python Office Hours Q&A (Virtual)
February 9, 2022

Python Atlanta
February 10, 2022

Python Miami
February 12 to February 13, 2022

PyDelhi User Group Meetup
February 12, 2022

PyCon Iran 2022
February 16 to February 19, 2022

Python Web Conference 2022 (Virtual)
March 21 to March 25, 2022
Happy Pythoning!
Copyright © 2022 PyCoder’s Weekly, All rights reserved.