Issue #468

Python Types in the Wild, Making Packages in 2021, How to Contribute to Python, and More

April 13, 2021

Python Types in the Wild, Making Packages in 2021, How to Contribute to Python, and More
#468 – APRIL 13, 2021 VIEW IN BROWSER
The PyCoder’s Weekly Logo
Python 3 Types in the Wild: A Tale of Two Type Systems
This academic paper from researchers at the Rensselaer Polytechnic Institute and IBM TJ Watson Research Center examines the MyPy and PyType tools and explores how Python developers use type annotations. The researchers collected over 70,000 Python GitHub repositories and found that only 2,678 had Python 3-style type annotations, most of which fail to type-check with either of the two tools. The paper’s third section is quite accessible and has a lot of interesting analysis.

How to Make an Awesome Python Package in 2021
The headache often associated with Python packaging is starting to fade away. Don’t believe me? Check out this step-by-step guide to creating and setting up a package repository. You’ll learn how to create a test package on TestPyPI, create a pyproject.toml file with flit, set-up linters and tests, GitHub Actions workflows, and more.

Datadog APM Provides Deeper, More Meaningful Trace Data to Quickly Resolve Application Problems
Datadog’s distributed tracing and APM generates flame graphs from real requests, enabling teams to visualize app performance in real-time. Engineering teams can seamlessly pivot to related logs and metrics without switching tools for fast troubleshooting and MTTR. Try Datadog APM free →

Start Contributing to Python: Your First Steps
In this quick introduction, you’ll see how you can take your first steps toward contributing to Python. You’ll discover various ways you can contribute and get to know some of the resources that will help you along the way.

Start Managing Multiple Python Versions With pyenv
Learn how to install multiple Python versions and switch between them with ease, including project-specific virtual environments, with pyenv.

PyCharm 2021.1 Is Out!
This release includes faster indexing, enhanced WSL 2 support, and an exciting new collaboration tool called Code With Me.
JETBRAINS.COM • Shared by Bartosz Zaczyński

PDFx V1.4.1 Is Now Available
PDFx is a tool to extract text, links, references, and metadata from PDF files and URLs. This release doesn’t include many new features but is rather a full update of the package repository to current Python standards, including testing and coverage, linting and static checks, GitHub workflows, and more.

Wing Python IDE 7.2.9 Released
This release includes remote development for 64-bit Raspberry Pi, improved auto-closing of quotes, optimized change tracking, and more.

PyPy v7.3.4 Released
This release includes two interpreters supporting the syntaxes for Python 2.7 and 3.7.


Why Does Pandas None | True Return False When Python None or True Returns True?
| represents the “or” operation, but when used in a boolean index in Pandas, it doesn’t behave the same way as Python’s or as you might expect — if you go off of name alone. The | operator is a bitwise operator, which only works on integer values. In fact, one could say that Python doesn’t really have a true logical “or” operator, since technically or is a short-circuit operator.

Python Jobs

Intermediate Python Developer (Boulder, CO, USA)

Software Engineer (New York, NY, USA)

Data Engineer (Seattle, WA, USA)

Software Development Engineer (Indianapolis, IN, USA)

More Python Jobs >>>

Articles & Tutorials

Using PyTorch + NumPy? You’re Making a Mistake
There’s a subtle bug that’s easy to introduce when using these packages, and it’s likely that many projects suffer from the bug. The issue has to do with how data is loaded, pre-processed, and augmented in PyTorch. If your training pipeline is bottlenecked by data pre-processing, you might decide to load the data in parallel. The canonical way of achieving this results in identical augmentations and can lead to performance degradation, but there’s a way to fix the problem.

How Python Dictionaries Work
Dictionaries are an important part of Python — not just because Python programmers use them a lot, but also because they are used internally by the Python interpreter to run Python code. In this in-depth article, you’ll learn about hash tables and hash functions as well as how Python dictionaries work behind the scenes.

[Free Virtual] How We Built Real-Time Full-Text Website Search with RediSearch
Join us at RedisConf where we feature this topic and more than 60 breakout sessions, 25% of which will be presented by Redis Enterprise customers. Learn about real-world use cases across three tracks. Register today →

Computer Vision and Embroidery
Andrew Healey’s wife wanted to find out what thread colors were used in some of the embroidery hoop images posted to the r/embroidery subreddit, so he embarked on a weekend project to solve the problem using the OpenCV computer vision library. Learn how he did it in this short, fun read, and then check out the source code over on his GitHub repository.

Getting Started With Refactoring Your Python Code
Do you think it’s time to refactor your Python code? What should you think about before starting this task? Listen Brendan Maginnis and Nick Thapen from discuss Sourcery in this episode of the Real Python Podcast. Sourcery is an automated refactoring tool that integrates into your IDE and suggests improvements to your code.

The k-Nearest Neighbors (kNN) Algorithm in Python
k-Nearest Neighbors (kNN) is a non-linear supervised machine learning algorithm suitable for both classification and regression problems. In this tutorial, you’ll learn all about the kNN algorithm in Python, including how to implement kNN from scratch, kNN hyperparameter tuning, and improving kNN performance using bagging.

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 →

superset: A Data Visualization and Data Exploration Platform

Python-Raytracer: A Basic Ray Tracer That Exploits NumPy Arrays and Functions to Work Fast

layout-parser: A Python Library for Document Layout Understanding

jurigged: Hot Reloading for Python

github-actions-updater: Like GitHub’s Dependabot but for GitHub Actions
GITHUB.COM/SAADMK11 • Shared by Maksudul Haque

📆🐍 Upcoming Python Events

⋅ Real Python Office Hours (Virtual) April 14, 2021

⋅ GeoPython 2021 April 22 – 24, 2021

⋅ PyCon Israel 2021 (Virtual) May 2 – 3, 2021

⋅ PyCon 2021 (Virtual) May 12 – 18, 2021

⋅ DjangoCon Europe 2021 (Virtual) June 2 – 6, 2021

⋅ PyCon India 2021 September 17 – 20, 2021
Happy Pythoning!
Copyright © 2021 PyCoder’s Weekly, All rights reserved.