🐍📰 D-Strings Could End Your textwrap.dedent() Days and Other Python News for April 2026 D-strings proposed to kill textwrap.dedent(), Python 3.15 alpha 7 ships lazy imports, GPT-5.4 launches, and Python Insider moves home https://lnkd.in/gG8SQFmT
Python 3.15 Alpha 7 and D-strings Update
More Relevant Posts
-
Python scope is one of those topics that separates developers who debug fast from those who don't. The language gives you no warning when a variable resolves to an unexpected value. It simply executes, returns a result, and moves on. Tracking down the source of that behaviour - without a solid mental model of how Python resolves names - can cost hours. The LEGB rule isn't complicated. But it's rarely taught with the depth it deserves. I wrote a free guide to change that: → How Python's name resolution actually works under the hood → The LEGB lookup chain with concrete, practical examples → Enclosing scopes and closure behaviour explained clearly → When global and nonlocal are appropriate - and when they signal a design problem → The scope patterns most likely to introduce silent bugs in real codebases Download it free: https://lnkd.in/djp6HJdD #Python #SoftwareEngineering #PythonDevelopment #BackendDevelopment
To view or add a comment, sign in
-
If you use Cursor or Claude Code to write Python you've probably noticed LLMs have some odd habits. Claude especially loves hasattr/getattr calls, unexplained function-scope imports, bare excepts, passing True/False as positional args with no context, and defaulting to dataclasses when your project uses Pydantic. I use agents pretty heavily to build MA-Gym (my open source multi-agent RL library, v-1.0.0 pending soon) and a lot of our internal tooling at DeepFlow. I kept catching the same stuff in review, so I wrote a linter in Rust to do it automatically. slopcop. 16 rules, tree-sitter based, zero false positives on strings/comments, sub 100ms, drops into CI/CLI in one line. pip install slopcop https://lnkd.in/eiUK2j4p Tell me what stupid Python idioms your agents keep writing and I'll add rules for them.
To view or add a comment, sign in
-
".env" Files Explained: Never Commit to GitHub, Python ".env" Files - Part Two. Learn how to use .env files in Python to protect sensitive credentials and never upload them to GitHub. Discover best practices to share with your teammates.
To view or add a comment, sign in
-
".env" Files Explained: Never Commit to GitHub, Python ".env" Files - Part Two. Learn how to use .env files in Python to protect sensitive credentials and never upload them to GitHub. Discover best practices to share with your teammates.
To view or add a comment, sign in
-
If your Python scripts are making 50 API calls, synchronous code spends most of its time waiting around doing absolutely nothing. Suresh Vina has written an intro to async Python using a simple analogy: boiling a kettle and making toast at the same time. Sync code does one, then the other. Async runs both concurrently. Same two tasks: 5 seconds sync, 3 seconds async. It’s not a big deal when making breakfast. But scale that concept across dozens of API calls and the difference adds up. The Infrahub Python SDK supports both sync and async natively. Switching between them is simple. Suresh walks through the core concepts, shows side-by-side code examples, and builds up to running the same operation across multiple sites concurrently. If async Python has been sitting on your "I should learn that someday" list, now’s your chance to *get up to speed*. (See what we did there? 😉) Link in comments 👇
To view or add a comment, sign in
-
-
I have scraped Python's Discourse to find the most popular PEPs based on likes, views, comments. Here are the top 5 PEPs that are targeting the upcoming Python version 3.15: PEP-810: 𝐄𝐱𝐩𝐥𝐢𝐜𝐢𝐭 𝐥𝐚𝐳𝐲 𝐢𝐦𝐩𝐨𝐫𝐭𝐬 Status: Accepted Adds the `lazy` keyword for imports, so the actual import of the module is deferred to its first use PEP-803: 𝐃𝐢𝐬𝐩𝐥𝐚𝐲 𝐒𝐲𝐧𝐭𝐚𝐱 𝐟𝐨𝐫 𝐭𝐡𝐞 𝐄𝐦𝐩𝐭𝐲 𝐒𝐞𝐭 Status: Draft An empty set can be initialized like this: myset = {/} PEP-791: 𝐦𝐚𝐭𝐡.𝐢𝐧𝐭𝐞𝐠𝐞𝐫 - 𝐬𝐮𝐛𝐦𝐨𝐝𝐮𝐥𝐞 𝐟𝐨𝐫 𝐢𝐧𝐭𝐞𝐠𝐞𝐫-𝐬𝐩𝐞𝐜𝐢𝐟𝐢𝐜 𝐦𝐚𝐭𝐡𝐞𝐦𝐚𝐭𝐢𝐜𝐬 𝐟𝐮𝐧𝐜𝐭𝐢𝐨𝐧𝐬 Status: Final Cleans up the std library for math and move functions returning integers to their own submodule PEP-814: 𝐀𝐝𝐝 𝐟𝐫𝐨𝐳𝐞𝐧𝐝𝐢𝐜𝐭 𝐛𝐮𝐢𝐥𝐭-𝐢𝐧 𝐭𝐲𝐩𝐞 Status: Final An immutable dictionary can be created like this: frozendict({'a': 1}) PEP-822: 𝐃𝐞𝐝𝐞𝐧𝐭𝐞𝐝 𝐌𝐮𝐥𝐭𝐢𝐥𝐢𝐧𝐞 𝐒𝐭𝐫𝐢𝐧𝐠 (𝐝-𝐬𝐭𝐫𝐢𝐧𝐠) Status: Draft Automatically remove common intendation in multi-line strings for cleaner definition of multi-line strings in source code Not all of these are final as you can see, so some might not land in Python 3.15 (if at all) Admittedly, mostly smaller changes. But all in all quite useful stuff.
To view or add a comment, sign in
-
-
The Zen of Python, by Tim Peters Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren't special enough to break the rules. Although practicality beats purity. Errors should never pass silently. Unless explicitly silenced. In the face of ambiguity, refuse the temptation to guess. There should be one-- and preferably only one --obvious way to do it. Although that way may not be obvious at first unless you're Dutch. Now is better than never. Although never is often better than *right* now. If the implementation is hard to explain, it's a bad idea. If the implementation is easy to explain, it may be a good idea. Namespaces are one honking great idea -- let's do more of those!
To view or add a comment, sign in
-
🐍 Which Python package manager should you actually use in 2025? I just published a deep-dive guide covering everything from the classics to the tools reshaping the ecosystem right now: → pip, pipenv, Poetry, conda, and the blazing-fast uv → Python version managers: pyenv, asdf, and why uv is doing it all → A decision flowchart so you never have to Google this again → Migration paths between tools → Where Python packaging is headed next Whether you're a solo dev tired of dependency hell or a team lead trying to standardize your stack — this one's for you. 🔗 https://lnkd.in/gd43kMfp Would love to hear what your team is using these days. Still on pip? Already moved to uv? Drop it in the comments 👇 #Python #SoftwareDevelopment #DevTools #Programming #OpenSource
To view or add a comment, sign in
-
I’ve published my first technical article: a walkthrough of the SOLID principles—with Python examples. It started as “I’ve heard these letters everywhere—what do they actually mean in code?” Turning that into something concrete helped me more than skimming another diagram. In the post I break things down into bite-sized pieces, including: • Single Responsibility: One job per module—easier to reason about and change. • Open/Closed: Extend behavior without rewriting existing code. • Liskov Substitution: Subtypes that don’t break expectations. • Interface Segregation: Small, focused contracts instead of fat interfaces. • Dependency Inversion: Depend on abstractions, not concrete details. Beyond the theory, each section includes short Python snippets so the ideas map to something you can run and tweak—not just memorize. The full post is here: https://lnkd.in/gFXSE4d9 #SoftwareEngineering #SOLID #Python #CleanCode #OOP #DesignPatterns
To view or add a comment, sign in
-
I’ve been using Jupyter notebooks for years, but they tend to get messy once they stop being "temporary". I recently tried marimo, and it feels like a different approach: • notebooks as plain Python files • dependency-based execution (no more weird states) • much cleaner to keep in git What I like most is that it sits somewhere between a notebook and a small app. I also show a real example: using it to recover deleted S3 files. 👉 https://lnkd.in/d_YdRCbd
To view or add a comment, sign in
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development