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

Edge 392: Meet RAFT: UC Berkeley's New Method to Improve RAG Patterns in LLMs

Thursday, May 2, 2024

The method brings the best of RAG and supervised fine tuning. ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

Airbnb Icons 🏠, Microsoft's OpenAI email leaks 🤖, software friction 👨‍💻

Thursday, May 2, 2024

Airbnb's Icons is a new collection of experiences hosted by big names in music, film, television, arts, sports, and more Sign Up |Advertise|View Online TLDR Together With Dollar Flight Club TLDR

📧 Did you want this discount?

Thursday, May 2, 2024

Your chance to save on MMA is about to end. ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌

Scoop: Tiger Global-backed Innovaccer in talks to raise $250M

Wednesday, May 1, 2024

Plus: An update on Google's layoffs and the social platform X didn't see coming View this email online in your browser By Christine Hall Wednesday, May 1, 2024 Welcome to TechCrunch PM. Today,

🖥️ Why I'm Never Going Back to a Windows PC — Tips Before You Buy a Smart Ring

Wednesday, May 1, 2024

Also: How to Clear the Moisture Detected Warning on Samsung Phones, and More How-To Geek Logo May 1, 2024 Did You Know A single 1 oz shot of espresso only has approximately 40 mg of caffeine, whereas a

Daily Coding Problem: Problem #1428 [Hard]

Wednesday, May 1, 2024

Daily Coding Problem Good morning! Here's your coding interview problem for today. This problem was asked by Microsoft. Given an array of positive integers, divide the array into two subsets such

Top Tech Deals 👀 Samsung Gaming Monitor, Pixel Watch 2, MacBook Air, and More

Wednesday, May 1, 2024

Get a discounted M3 MacBook Air or expand your Xbox storage. How-To Geek Logo May 1, 2024 Top Tech Deals: Samsung Gaming Monitor, Pixel Watch 2, MacBook Air, and More Get a discounted M3 MacBook Air or

Infographic | Visualizing Global Gold Production in 2023 🏅

Wednesday, May 1, 2024

Gold production in 2023 was led by China, Australia, and Russia, with each outputting over 300 tonnes. View Online | Subscribe Presented by: Access European benchmarks with a trusted 25-year history

⚙️ GPT-5 may be releasing sooner than expected

Wednesday, May 1, 2024

Plus: Amazon rebrands AI branch ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌

Noonification: How to Create a CI/CD Pipeline Using GitHub and AWS EC2

Wednesday, May 1, 2024

Top Tech Content sent at Noon! Get Algolia: AI Search that understands How are you, @newsletterest1? 🪐 What's happening in tech today, May 1, 2024? The HackerNoon Newsletter brings the HackerNoon