A Closer Look At Structural Pattern Matching // New In Python 3.10!

ArjanCodes ยท Beginner ยท๐Ÿ—๏ธ Systems Design & Architecture ยท4y ago
๐Ÿ’ก Learn how to design great software in 7 steps: https://arjan.codes/designguide. In this video, I show an example of structural pattern matching, a pretty powerful feature that's part of Python 3.10. There are a couple of really nice things you can do with this, and although it resembles the traditional switch statement, it goes far beyond what the 'wicked switch' can do. The code I worked on in this video is available here: https://github.com/ArjanCodes/2021-structural-pattern-matching. ๐ŸŽ“ ArjanCodes Courses: https://www.arjancodes.com/courses. ๐Ÿ’ฌ Join my Discord server: https://discordโ€ฆ
Watch on YouTube โ†— (saves to browser)

Chapters (8)

Intro
1:02 Explaining the example
1:35 Simple pattern match example
3:37 A more elaborate match example
7:49 Match with conditions
9:30 Match with objects
14:42 Caveats of using structural pattern matching
16:11 Other Python 3.10 features & final thoughts

Playlist

Uploads from ArjanCodes ยท ArjanCodes ยท 28 of 60

1 Full stack WEB DEVELOPMENT in 2021 - the ULTIMATE tech stack for FAST web app development
Full stack WEB DEVELOPMENT in 2021 - the ULTIMATE tech stack for FAST web app development
ArjanCodes
2 FROM PRODUCT IDEA TO SOFTWARE - turn your idea into reality in a few steps
FROM PRODUCT IDEA TO SOFTWARE - turn your idea into reality in a few steps
ArjanCodes
3 Cohesion and Coupling: Write BETTER PYTHON CODE Part 1
Cohesion and Coupling: Write BETTER PYTHON CODE Part 1
ArjanCodes
4 Dependency Inversion: Write BETTER PYTHON CODE Part 2
Dependency Inversion: Write BETTER PYTHON CODE Part 2
ArjanCodes
5 The Strategy Pattern: Write BETTER PYTHON CODE Part 3
The Strategy Pattern: Write BETTER PYTHON CODE Part 3
ArjanCodes
6 Build a GLASSMORPHISM React Component - Typescript & Material-UI
Build a GLASSMORPHISM React Component - Typescript & Material-UI
ArjanCodes
7 Observer Pattern Tutorial: I NEVER Knew Events Were THIS Powerful ๐Ÿš€
Observer Pattern Tutorial: I NEVER Knew Events Were THIS Powerful ๐Ÿš€
ArjanCodes
8 100% CODE COVERAGE - Think You're Done? Think AGAIN.โ˜
100% CODE COVERAGE - Think You're Done? Think AGAIN.โ˜
ArjanCodes
9 Two UNDERRATED Design Patterns ๐Ÿ’ก Write BETTER PYTHON CODE Part 6
Two UNDERRATED Design Patterns ๐Ÿ’ก Write BETTER PYTHON CODE Part 6
ArjanCodes
10 1000 Subscribers! ๐Ÿš€ WHY I Started this Channel and WHAT'S NEXT
1000 Subscribers! ๐Ÿš€ WHY I Started this Channel and WHAT'S NEXT
ArjanCodes
11 Channel Trailer ArjanCodes - March 2021
Channel Trailer ArjanCodes - March 2021
ArjanCodes
12 Exception Handling Tips in Python โš  Write Better Python Code Part 7
Exception Handling Tips in Python โš  Write Better Python Code Part 7
ArjanCodes
13 Monadic Error Handling in Python โš  Write Better Python Code Part 7B
Monadic Error Handling in Python โš  Write Better Python Code Part 7B
ArjanCodes
14 GW BASIC Games I Wrote When I Was a Kid ๐ŸŽฎ Running 30 Year Old Code
GW BASIC Games I Wrote When I Was a Kid ๐ŸŽฎ Running 30 Year Old Code
ArjanCodes
15 Why You Should Think About SOFTWARE ARCHITECTURE in Python ๐Ÿ’ก
Why You Should Think About SOFTWARE ARCHITECTURE in Python ๐Ÿ’ก
ArjanCodes
16 Uncle Bobโ€™s SOLID Principles Made Easy ๐Ÿ€ - In Python!
Uncle Bobโ€™s SOLID Principles Made Easy ๐Ÿ€ - In Python!
ArjanCodes
17 QUESTIONABLE Object Creation Patterns in Python ๐Ÿค”
QUESTIONABLE Object Creation Patterns in Python ๐Ÿค”
ArjanCodes
18 If Youโ€™re Not Using Python DATA CLASSES Yet, You Should ๐Ÿš€
If Youโ€™re Not Using Python DATA CLASSES Yet, You Should ๐Ÿš€
ArjanCodes
19 Dependency INVERSION vs Dependency INJECTION in Python
Dependency INVERSION vs Dependency INJECTION in Python
ArjanCodes
20 CODE ROAST: Yahtzee - New Python Code Refactoring Series!
CODE ROAST: Yahtzee - New Python Code Refactoring Series!
ArjanCodes
21 7 UX Design Tips for Developers
7 UX Design Tips for Developers
ArjanCodes
22 Going All-in on Software Design in Python + an ANNOUNCEMENT ๐ŸŽ™
Going All-in on Software Design in Python + an ANNOUNCEMENT ๐ŸŽ™
ArjanCodes
23 ๐ŸŽ™ Interview with Sybren Stรผvel, Developer @ Blender 3D
๐ŸŽ™ Interview with Sybren Stรผvel, Developer @ Blender 3D
ArjanCodes
24 Composition Is Better Than Inheritance in Python
Composition Is Better Than Inheritance in Python
ArjanCodes
25 Do We Still Need Dataclasses? // PYDANTIC Tutorial
Do We Still Need Dataclasses? // PYDANTIC Tutorial
ArjanCodes
26 7 Python Code Smells to AVOID at All Costs
7 Python Code Smells to AVOID at All Costs
ArjanCodes
27 Answering Your Most Frequently Asked Python Questions // Q&A 07-2021
Answering Your Most Frequently Asked Python Questions // Q&A 07-2021
ArjanCodes
โ–ถ A Closer Look At Structural Pattern Matching // New In Python 3.10!
A Closer Look At Structural Pattern Matching // New In Python 3.10!
ArjanCodes
29 The Factory Pattern in Python // Separate Creation From Use
The Factory Pattern in Python // Separate Creation From Use
ArjanCodes
30 GitHub Copilot ๐Ÿค– The Future of Software Development?
GitHub Copilot ๐Ÿค– The Future of Software Development?
ArjanCodes
31 More Python Code Smells: Avoid These 7 Smelly Snags
More Python Code Smells: Avoid These 7 Smelly Snags
ArjanCodes
32 Solving A Common Issue With The Strategy Pattern // In Python
Solving A Common Issue With The Strategy Pattern // In Python
ArjanCodes
33 Test-Driven Development In Python // The Power of Red-Green-Refactor
Test-Driven Development In Python // The Power of Red-Green-Refactor
ArjanCodes
34 5 Tips To Keep Technical Debt Under Control
5 Tips To Keep Technical Debt Under Control
ArjanCodes
35 Refactoring A Tower Defense Game In Python // CODE ROAST
Refactoring A Tower Defense Game In Python // CODE ROAST
ArjanCodes
36 The Factory Design Pattern is Obsolete in Python
The Factory Design Pattern is Obsolete in Python
ArjanCodes
37 Why the Plugin Architecture Gives You CRAZY Flexibility
Why the Plugin Architecture Gives You CRAZY Flexibility
ArjanCodes
38 Software Testing Theory + A Few Less Obvious Testing Techniques
Software Testing Theory + A Few Less Obvious Testing Techniques
ArjanCodes
39 How to Implement the Strategy Design Pattern in Python
How to Implement the Strategy Design Pattern in Python
ArjanCodes
40 Refactoring A Data Science Project Part 1 - Abstraction and Composition
Refactoring A Data Science Project Part 1 - Abstraction and Composition
ArjanCodes
41 Refactoring A Data Science Project Part 2 - The Information Expert
Refactoring A Data Science Project Part 2 - The Information Expert
ArjanCodes
42 Refactoring A Data Science Project Part 3 - Configuration Cleanup
Refactoring A Data Science Project Part 3 - Configuration Cleanup
ArjanCodes
43 Protocol Or ABC In Python - When to Use Which One?
Protocol Or ABC In Python - When to Use Which One?
ArjanCodes
44 Purge These 7 Code Smells From Your Python Code
Purge These 7 Code Smells From Your Python Code
ArjanCodes
45 Real-Life Case of the Command Design Pattern
Real-Life Case of the Command Design Pattern
ArjanCodes
46 How To Make The Command Pattern More Flexible With One Simple Change
How To Make The Command Pattern More Flexible With One Simple Change
ArjanCodes
47 Running A Software Development YouTube Channel
Running A Software Development YouTube Channel
ArjanCodes
48 Refactoring A PDF And Web Scraper Part 1 // CODE ROAST
Refactoring A PDF And Web Scraper Part 1 // CODE ROAST
ArjanCodes
49 Refactoring A PDF And Web Scraper Part 2 // CODE ROAST
Refactoring A PDF And Web Scraper Part 2 // CODE ROAST
ArjanCodes
50 How To Easily Do Asynchronous Programming With Asyncio In Python
How To Easily Do Asynchronous Programming With Asyncio In Python
ArjanCodes
51 The Software Designer Mindset
The Software Designer Mindset
ArjanCodes
52 NEVER Worry About Data Science Projects Configs Again
NEVER Worry About Data Science Projects Configs Again
ArjanCodes
53 Powerful VSCode Tips And Tricks For Python Development And Design
Powerful VSCode Tips And Tricks For Python Development And Design
ArjanCodes
54 8 Python Coding Tips - From The Google Python Style Guide
8 Python Coding Tips - From The Google Python Style Guide
ArjanCodes
55 What Is Encapsulation And Information Hiding?
What Is Encapsulation And Information Hiding?
ArjanCodes
56 8 Tips For Becoming A Senior Developer
8 Tips For Becoming A Senior Developer
ArjanCodes
57 Building A Custom Context Manager In Python: A Closer Look
Building A Custom Context Manager In Python: A Closer Look
ArjanCodes
58 GraphQL vs REST: What's The Difference And When To Use Which?
GraphQL vs REST: What's The Difference And When To Use Which?
ArjanCodes
59 Let's Take The Bridge Pattern To The Next Level
Let's Take The Bridge Pattern To The Next Level
ArjanCodes
60 Refactoring a Battleship Game in Python // Code Roast Part 1 of 2
Refactoring a Battleship Game in Python // Code Roast Part 1 of 2
ArjanCodes
The Cloudflare Outage EXPLAINED
Next Up
The Cloudflare Outage EXPLAINED
Coding with Lewis