Issue #579

Using __call__(), Django Custom Sorts, Decorators, and More

May 30, 2023

Using __call__(), Django Custom Sorts, Decorators, and More
#579 – MAY 30, 2023 VIEW IN BROWSER
The PyCoder’s Weekly Logo
Python’s .__call__() Method: Creating Callable Instances
In this tutorial, you’ll learn what a callable is in Python and how to create callable instances using the .__call__() special method in your custom classes. You’ll also code several examples of practical use cases for callable instances in Python.
REAL PYTHON

Sorting a Django Queryset Using Custom Attributes
“Typically, Django allows sorting a queryset by any attribute on the model or related to it in either ascending or descending order. However, what if you need to sort the queryset following a custom sequence of attribute values?”
REDOWAN DELOWAR

Analyze Your Python Code for Security Issues for Free
Semgrep is trusted by hundreds of thousands of developers at top companies, such as GitLab, Snowflake, Slack, and many more, to ensure the security of their code (SAST) and dependencies (SCA). Add your project in 1 minute and see for yourself →
SEMGREPsponsor

Python Decorators and How to Use Them Effectively
This article covers the importance and use of decorators in your code. It introduces you to both function and class decorators and helps you write your own.
TONIE VICTOR

PyPI Was Subpoenaed
In March and April 2023, PyPI received three subpoenas for user data from the US Department of Justice. This blog post covers what was requested and how the PyPI is working to clarify what they retain and can make available in the future. See the associated Hacker News discussion.
PYPI.ORG

Python 3.12.0 Beta 1 Released
CPYTHON DEV BLOG

Removing PGP From PyPI
PYPI.ORG


Discussions


How to Move From Dev to Management/Team Lead Role?
HACKER NEWS


Articles & Tutorials


Writing Python Like It’s Rust
This blog post from Jakub talks about how writing code in Rust has informed a more rigorous approach to his Python. He now uses types more frequently, absorbing the strictness of Rust in his Python coding style. Associated Hacker News conversation
JAKUB BERANEK

Publishing Python Packages to PyPI
In this video course, you’ll learn how to create a Python package for your project and how to publish it to PyPI, the Python Package Repository. Quickly get up to speed on everything from naming your package to configuring it using setup.cfg.
REAL PYTHON course

A New Approach to Find High Paying Remote Jobs
Trusted by 2000+ developers from 120+ countries. Proxify provides software developers with an effortless, fast, and reliable way to find high-paying remote job opportunities. Join the most developer-friendly community today and start working on engagements with Top clients in the USA & EU →
PROXIFYsponsor

Using k-Nearest Neighbors (kNN) in Python
In this video course, you’ll learn all about the k-nearest neighbors (kNN) algorithm in Python, including how to implement kNN from scratch. Once you understand how kNN works, you’ll use scikit-learn to facilitate your coding process.
REAL PYTHON course

Programming Types and Mindsets
David expounds on why we should appreciate the features of other languages and how they enable the creativity of their developers, even if we don’t like those features ourselves.
DAVID HANSSON

Using a Golang Package in Python Using Gopy
Including a Golang package in Python using Gopy: A simple way to leverage the power of Golang packages in Python applications.
ARJUN MAHISHI • Shared by Prathamesh

Choosing a Good File Format for Pandas
CSV, JSON, Parquet — which data format should you use for your Pandas data? Itamar compares them and makes recommendations.
ITAMAR TURNER-TRAURING

The Power of Bit Manipulation
In this article, you learn about bit manipulation and how to solve problems efficiently using it in Python.
ANURAG VERMA


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 →

unimport: Remove Unused Import Statements in Your Code
GITHUB.COM/HAKANCELIKDEV • Shared by Hakan Çelik

ChatSQL: Convert Plain Text to SQL Through ChatGPT
GITHUB.COM/ADEMAKDOGAN • Shared by Adem AKDOGAN

pyserde: Dataclass Based Serialization Library
GITHUB.COM/YUKINARIT

pyscan: Rust Based Python Dependency Vulnerability Scanner
GITHUB.COM/ASWINNNN

guidance: Language for Controlling Large Language Models
GITHUB.COM/MICROSOFT

📆🐍 Upcoming Python Events


DjangoCon Europe 2023
May 29 to June 3, 2023

Weekly Real Python Office Hours Q&A (Virtual)
May 31, 2023

Canberra Python Meetup
June 1, 2023

PyData London 2023
June 2 to June 5, 2023

PyDay La Paz 2023
June 3 to June 4, 2023
Happy Pythoning!
Copyright © 2023 PyCoder’s Weekly, All rights reserved.