Annotating self, Context Managers, PEP 723, and More

#590 – AUGUST 15, 2023 VIEW IN BROWSER
The PyCoder’s Weekly Logo
How to Annotate Methods That Return self
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.
REAL PYTHON

Creating a Context Manager in Python
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.
TREY HUNNER • Shared by Trey Hunner

If App Signup is Giving You Headaches, Here’s Your Answer: FusionAuth’s Modern Guide to OAuth
Our Modern Guide to OAuth is chock full of real-world examples, without fluffy BS. We made it, you learn it. It’s a win-win. And when you’re ready, you can spin up an instance of FusionAuth for FREE in just five minutes →
FUSIONAUTHsponsor

PEP 723: Embedding pyproject.toml in Single-File Scripts
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.
PYTHON.ORG

PyPI: 2FA Enforcement for New User Registrations
PYPI.ORG

PSF Announces New PyPI Safety & Security Engineer
PYTHON SOFTWARE FOUNDATION

Python 3.12.0 RC 1 Released
CPYTHON DEV BLOG


Articles & Tutorials


Prompt Engineering: A Practical Example
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.
REAL PYTHON

Why Static Languages Suffer From Complexity
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.
HIRROLOT

Companies like GitLab, Snowflake, and Slack Scan Their Code for Vulnerabilities Using Semgrep
Scan your code and dependencies for security vulnerabilities for free with Semgrep - the trusted OSS tool used by top companies like GitLab, Snowflake, and Slack. No security expertise needed, simply add your project and let Semgrep do the work in just minutes →
SEMGREPsponsor

Python’s list: A Deep Dive With Examples
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.
REAL PYTHON

A Complete Comparison of Sorting Algorithms
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.
CODERSLEGACY.COM • Shared by Raahim Siddiqi

Support Bootstrap-Alerts in Python-Markdown
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.
FLORIAN DAHLITZ • Shared by Florian Dahlitz

How a Simple Import Can Modify the Interpreter
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.
KEN SCHUTTE

Does Elegance Matter?
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.
MATHSPP.COM • Shared by Rodrigo Girão Serrão

Why Python Is Amazing
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.
JOS VISSER

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

Learn How to Deploy Scientific AI Models to Edge Environments, Using OpenVINO Model Server
🤔 Can cell therapy and AI be used together? Learn how to efficiently build and deploy scientific AI models using open-source technologies with Beckman Coulter Life Sciences at our upcoming DevCon OpenVINO webinar. #DevCon2023
INTEL CORPORATIONsponsor

Adversarial Attacks on Aligned LLMs
Deep CS paper on how to abuse Large Language Models and work around restrictions where the model is refusing to answer.
ZOU, WANG, KOLTER, & FREDRIKSON

2022 PSF Annual Report
The annual report from the Python Software Foundation details all the changes and events at the PSF last year.
PYTHON.ORG


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 →

dpv: Alternative to pyenv-virtualenv and virtualenvwrapper
GITHUB.COM/CAIOARIEDE • Shared by Caio Ariede

nodice-cli: Word List Generator With No Dependencies
GITHUB.COM/AVNIGO

briefcase: Convert Python to a Native Application
GITHUB.COM/BEEWARE

django_simple_notification: REST Notification System
GITHUB.COM/MAHMOUDNASSER01

pyOCD: Python for Arm Cortex-M Microcontrollers
GITHUB.COM/PYOCD

📆🐍 Upcoming Python Events


Weekly Real Python Office Hours Q&A (Virtual)
August 16, 2023

PyData Bristol Meetup
August 17, 2023

PyLadies Dublin
August 17, 2023

DjangoConAU 2023
August 18 to August 19, 2023

PyCon AU 2023
August 18 to August 23, 2023

Chattanooga Python User Group
August 18 to August 19, 2023

PyCon Latam 2023
August 24 to August 27, 2023
Happy Pythoning!
Copyright © 2023 PyCoder’s Weekly, All rights reserved.
You are receiving this email because you opted in on our website at pycoders.com
Our mailing address: DevCademy Media Inc. · #720-999 West Broadway, Vancouver BC V5Z 1K5, Canada

Unsubscribe | Update Email Address

Older messages

Pandas 2.0, Foreign Functions, Versioning, and More

Tuesday, August 8, 2023

Exploring Pandas 2.0 & Targets for Apache Arrow #589 – AUGUST 8, 2023 VIEW IN BROWSER The PyCoder's Weekly Logo Exploring Pandas 2.0 & Targets for Apache Arrow What are the new ways to

F-Strings in Py3.12, Profiling, Quirks, No-GIL, and More

Tuesday, August 1, 2023

Python 3.12 Preview: More Intuitive and Consistent F-Strings #588 – AUGUST 1, 2023 VIEW IN BROWSER The PyCoder's Weekly Logo Python 3.12 Preview: More Intuitive and Consistent F-Strings In this

Folium, 6502 Emulator, Pystack, and More

Tuesday, July 25, 2023

Creating Web Maps From Your Data With Python Folium #587 – JULY 25, 2023 VIEW IN BROWSER The PyCoder's Weekly Logo Creating Web Maps From Your Data With Python Folium You'll learn how to create

Mazes, Organizing Monoliths, Passing NumPy Arrays, and More

Tuesday, July 18, 2023

Mazes in Python Part 2: Storing and Solving #586 – JULY 18, 2023 VIEW IN BROWSER The PyCoder's Weekly Logo Mazes in Python Part 2: Storing and Solving In part two of this two-part project, you'

Python 3.12 Profiler, Netflix, Numba Vectorize, and More

Tuesday, July 11, 2023

Python 3.12 Preview: Support for the Linux Perf Profiler #585 – JULY 11, 2023 VIEW IN BROWSER The PyCoder's Weekly Logo Python 3.12 Preview: Support for the Linux Perf Profiler Python 3.12 will be

You Might Also Like

Sunday Digest | Featuring 'The World’s 20 Largest Economies, by GDP (PPP)' 📊

Sunday, December 22, 2024

Every visualization published this week, in one place. Dec 22, 2024 | View Online | Subscribe | VC+ | Download Our App Hello, welcome to your Sunday Digest. This week, we visualized public debt by

Android Weekly #654 🤖

Sunday, December 22, 2024

View in web browser 654 December 22nd, 2024 Articles & Tutorials Sponsored Solving ANRs with OpenTelemetry While OpenTelemetry is the new observability standard, it lacks official support for many

😸 Our interview with Amjad Masad

Sunday, December 22, 2024

Welcome back, builders Product Hunt Sunday, Dec 22 The Roundup This newsletter was brought to you by AssemblyAI Welcome back, builders Happy Sunday! We've got a special edition of the Roundup this

C#537 Automating Santa's Workshop with NServiceBus

Sunday, December 22, 2024

Using event-driven architecture for effective gift delivery 🎄🎁 ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌

The Race for AI Reasoning is Challenging our Imagination

Sunday, December 22, 2024

New reasoning models from Google and OpenAI ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏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libraries that best meet

Weekend Reading — Happy "That's a January Problem" week

Saturday, December 21, 2024

Can Christmas season start a little earlier this year Tech Stuff Ramsey Nasser fuck it happened i am in a situation where i do actually need to reverse a linked list Atuin I just learned about Atuin

Daily Coding Problem: Problem #1644 [Easy]

Saturday, December 21, 2024

Daily Coding Problem Good morning! Here's your coding interview problem for today. This problem was asked by IBM. Given an integer, find the next permutation of it in absolute order. For example,