Design Patterns in Python: Template Method | Amir Lavasani
Visualizing Architecture with Python's `diagrams` Library, Every dunder method in Python, Prompt Engineering: A Practical Example with some more interesting articles, packages and projects
News
Typosquatting Campaign Targets Python Developers
Phylum’s automated risk detection platform picked up another typosquat campaign targeting some attackers’ favourite targets in PyPI. With over 500 typosquat variations published so far. PyPI has promptly removed the malicious packages and temporarily suspended new project and account creations to prevent further fallout from this attack.
Python 3.11.9 is now available
Python 3.12.3 and 3.13.0a6 released
Last alpha release of Python 3.13. Just one more month until the feature freeze
Bringing Python to Workers using Pyodide and WebAssembly
Are you a big fan of Cloudflare workers? Then great news for you, we can now write them in Python.
PEP 744 – JIT Compilation
Earlier this year, an experimental “just-in-time” compiler was merged into CPython’s main development branch. While recent CPython releases have included other substantial internal changes, this addition represents a particularly significant departure from the way CPython has traditionally executed Python code. As such, it deserves wider discussion.
Articles
Design Patterns in Python: Template Method
Design patterns are like tried & tested paths. Those will save you from several future problems like bugs, code duplication, code complexity, etc. Amir Lavasani covered the Template Method in this article. Not only that, he is writing an article series for Design patterns here.
# Amir Lavasani
Visualizing Architecture with Python's `diagrams` Library
If you are thinking of creating your architecture diagram but don’t want to go through all of those headaches of using drawing tools then you can do it using code too. In this article, Nuno Bispo covered this topic with simple examples using the “diagrams” library.
# Nuno Bispo
Every dunder method in Python
I am sure you might have used dunder methods("double underscore" methods) at least __init__. Like that, there are tons of dunder methods which allow us to deeply customize how our custom classes interact. Trey Hunner in this article covered them, he even created a cheatsheet of them you will find at the end of the article.
# Trey Hunner
Prompt Engineering: A Practical Example
I am sure by now you have a good understanding of prompt engineering. If not then you should check out this article by Martin Breuss. He covered many of the prompt engineering techniques (Zero-Shot Prompting, Few-Shot Prompting, Delimiters, Numbered Steps, Role Prompts, Chain-of-Thought (CoT) Prompting, Structured Output & Labeled Conversations) with examples & code.
# Martin Breuss
Fake-SMS: How Deep Does the Rabbit Hole Really Go?
If you find obfuscated code in any open source or free tool it's better to stay away from that. Of Course, in closed source code, we won’t know about the code at all. Aleksa Majkić took one open-source tool called Fake-SMS and went deep to explain the malware present in that.
# Aleksa Majkić
Advanced OOP in Python
If you want to learn OOP concepts then you should read this article by Serdar Gundogdu. Very detailed & very long but you will know all the OOP concepts (Classes and objects, Inheritance, Polymorphism, Encapsulation and Classes in Python) including Dynamically typing, static type checking and overloading.
# Serdar Gundogdu
Primer on Python Decorators
If you used any framework like Flask or FastAPI or Django you might have seen decorators not only that if you touched property or dataclasses you might have seen decorators. If you want to understand exactly decorators' work then you should check this amazing article by Geir Arne Hjelle.
# Geir Arne Hjelle
Interesting Packages and Projects to explore
pyupgrade - A tool (and pre-commit hook) to automatically upgrade syntax for newer versions of the language.
Eel - A little Python library for making simple Electron-like HTML/JS GUI apps
art - 🎨 ASCII art library for Python
About Upcoming Python Events
Django Girls Matola #3
Apr 13, 2024
Inland Empire Python Users Group monthly meeting
Apr 16, 2024
NZPUG-Auckland: Data Ethics
Apr 17, 2024
Python Meeting Düsseldorf
Apr 17, 2024
PyTexas 2024
Apr 19 – 21, 2024
Python + DS fwdays'24 conference
Apr 20, 2024
BangPypers - Python April Meetup
Apr 20, 2024