That `InitVar` in a dataclass… do you actually know what it does? It looks like a field. It’s declared like a field. But it’s not really a field. In today’s video, I walk through 7 interesting things you can do with Python dataclasses. From automatic class registration and lightweight validation systems to cached derived values, self-building CLI parsers, and even using dataclasses as context managers. Most developers treat dataclasses like “nicer structs.” But they’re just normal Python classes with less boilerplate. And once you realize that, they become a design tool, not just a convenience. 👉 Watch the full video here: https://lnkd.in/eeEzkhJQ. #python #dataclasses #softwaredesign #cleancode #developers #arjancodes
Arjan Egges’ Post
More Relevant Posts
-
That `InitVar` in a dataclass… do you actually know what it does? It looks like a field. It’s declared like a field. But it’s not really a field. In today’s video, I walk through 7 interesting things you can do with Python dataclasses. From automatic class registration and lightweight validation systems to cached derived values, self-building CLI parsers, and even using dataclasses as context managers. Most developers treat dataclasses like “nicer structs.” But they’re just normal Python classes with less boilerplate. And once you realize that, they become a design tool, not just a convenience. 👉 Watch the full video here: https://lnkd.in/e5pkc7Ae. #python #dataclasses #softwaredesign #cleancode #developers #arjancodes
To view or add a comment, sign in
-
-
More knowledge graph experiments - this time, a port of Python's rdflib to Julia, but with much more, including an N3 reasoner (based on EYE), ProbLog, support for the 1.2 features of SPARQL, a SPARQL server https://lnkd.in/gJf6pWxF
To view or add a comment, sign in
-
Improved my Log Analyzer project with more practical SRE features 🚀 After building a basic log analyzer, I enhanced it to make it more flexible and closer to real-world usage. 🔧 What’s new: • Added CLI-based input handling for dynamic log file analysis • Implemented Top N error detection using Python’s Counter • Improved output formatting for better readability 💡 Why this matters: In real systems, logs are large and constantly changing — tools need to be flexible and configurable. This update helped me understand how to make scripts more production-ready. 🔗 Updated Repo: https://lnkd.in/dEZyK7qH Next step: planning to add regex-based parsing and error spike detection. Would love your feedback! #SRE #Python #DevOps #Observability #LearningInPublic #GitHub
To view or add a comment, sign in
-
-
Scale vector search to millions without rewriting your prototype code ⚡ Building semantic search typically starts with storing vectors in Python lists and computing cosine similarity manually. But brute-force comparison scales linearly with your dataset, making every query slower as your data grows. Qdrant is a vector search engine built in Rust that indexes your vectors for fast retrieval. Key features: • In-memory mode for local prototyping with no server setup • Seamlessly scale to millions of vectors in production with the same Python API • Built-in support for cosine, dot product, and Euclidean distance • Sub-second query times even for millions of vectors ☕️ Run this code: https://bit.ly/4cCI76w #VectorDatabase #Python #SemanticSearch #DataScience
To view or add a comment, sign in
-
-
We started with a single function. Added tools. Made it loop. Gave it memory. Tracked state. Persisted facts. Added guardrails. Let it plan. Eight lessons. All building on each other. Now they compose. 60 lines of Python. Remember my name is Alice, then add ten and five. → saves to memory, runs the tool, returns fifteen. New session. What is my name? → Alice. From memory. Delete the database. → Blocked. Before it even runs. Same sixty lines. Every feature you've built. No LangChain. No CrewAI. No AutoGen. Just json, pyfetch, and one HTTP call. This is the same architecture as every agent framework out there. The difference: you can read every line. The entire series is free. Runs in your browser. No setup. tinyagents.dev Day 9 of 9. Series complete. https://lnkd.in/gwmgUzex #AIAgents #BuildInPublic #Python #LLM #OpenSource
To view or add a comment, sign in
-
🚀 Day 51 of My Python Journey Today I solved Apply Discount to Prices on LeetCode. 🔍 Problem Overview: The problem gives a sentence containing words and prices (values starting with $). The task is to apply a given discount percentage to all valid prices and return the updated sentence. The updated prices must be formatted with exactly two decimal places. 🧠 Approach: • Split the sentence into individual words. • Check whether a word represents a valid price (starts with $ and the remaining characters are digits). • Convert the price to an integer and apply the discount formula. • Format the discounted price to two decimal places and rebuild the sentence. ⚡ Key Learnings: • Practiced string parsing and validation • Improved understanding of formatting numbers in Python • Strengthened problem-solving using conditional logic 📊 Complexity: • Time Complexity: O(n) • Space Complexity: O(n) Under the Guidance of : Rudra Sravan kumar and Manoj Kumar Reddy Parlapalli #Day51 #Python #LeetCode #DataStructures #Algorithms #CodingJourney #ProblemSolving #100DaysOfCode
To view or add a comment, sign in
-
-
"Data Science is about organization, starting from your Python environment. Cluttering the base installation leads to dependency conflicts (Version Hell) and instability. 🛑 That’s why Miniconda (Conda Environments) is crucial. By creating isolated environments for each project, we achieve: 1️⃣ Dependency Control: No version conflicts. 2️⃣ Reproducibility: Projects work anywhere. 3️⃣ Performance: Faster package management. Professionals keep their kitchens organized and their Conda environments isolated. 💡 #DataScience #Python #Miniconda #VirtualEnvironments #MachineLearning"
To view or add a comment, sign in
-
-
😵 Thread-local storage works great... until you move to async. Then the weird stuff starts. Request IDs bleeding between coroutines. Background tasks sharing state. “Random” bugs that disappear under logging. Sound familiar? Async doesn’t care about threads. It cares about execution context. In my latest article I explain: 🔍 Why threading.local() fails under asyncio 🧠 How ContextVars isolate state per coroutine ⚙️ Real examples with async tasks and request-scoped data 👉 https://lnkd.in/d_aVTDtW #python #softwaredevelopment #backend #engineering #asyncio
To view or add a comment, sign in
-
Day 4 of Python was a masterclass in decision-making. I stopped writing "scripts" and started writing "logic flows." Here’s what I learned about building a resilient program: 🔹 The Power of the 'If': From simple one-way decisions to complex Nested and Multi-way (elif) structures. It’s not just about "Yes or No"; it’s about mapping out every possible fog in the road. 🔹 Indentation is Architecture: In Python, a few spaces aren't just for clean looks—they are the law. Indentation tells the computer exactly which code belongs to which decision. If your alignment is off, your logic is off. 🔹 The (Try/Except): I learned how to anticipate human error. Instead of letting the program crash when a user enters a string instead of a number, I used try/except to catch the mistake gracefully and keep the engine running. I’m training my brain to remember that = assigns a value, but == asks a question. I am slowly getting there 🙂 Day 5 is moving into the world of Functions and Iterations (Loops). I’m shifting from making decisions to automating repetitive tasks. The pieces are finally starting to click together. #Python #CodingLogic #BuildInPublic #SoftwareDevelopment #TechJourney #ProblemSolving
To view or add a comment, sign in
-
-
Day 10 of my Python journey Missed the class, but caught up stronger Today’s focus: Lists & Real-world Logic ✔ Built a mini time converter (24hr → 12hr format) ✔ Understood list basics & nested indexing ✔ Explored list methods (append, extend, remove, pop) ✔ Learned the power of mutable data structures Big takeaway: Lists are not just storage — they’re powerful tools for solving real problems. Code link : https://lnkd.in/gTjGZd5X Consistency continues 🚀 #Python #100DaysOfCode #CodingJourney #FullStackDeveloper Codegnan Saketh Kallepu
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