Structural Pattern Matching - Exciting New Python Feature (3.10)

preview_player
Показать описание
Welcome back to another YouTube video! In this video, I'm going to be showing a new feature coming to Python version 3.10. This feature is Structural Pattern Matching, this is similar to a switch statement in other programming languages but much stronger.

📄 Resources 📄

⭐️ Timestamps ⭐️
00:00 | Python 3.10
02:18 | Structural Pattern Matching

◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️
💰 Courses & Merch 💰

🔗 Social Medias 🔗

🎬 My YouTube Gear 🎬

💸 Donations 💸
◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️

⭐️ Tags ⭐️
- Tech With Tim
- Python Version 3.10
- Python
- New Feature
- Structural Pattern Matching
- Switch

⭐️ Hashtags ⭐️
#TechWithTim #Python
Рекомендации по теме
Комментарии
Автор

I think the case(0, y) makes horizontal line with y provided, not a vertical, and vice versa.

alexybogomolov
Автор

Finally it would be easy and less chaotic to make command line programs.

KhannaSparsh
Автор

I was fascinated that Python avoided a switch statement and now I see this and think, "It was worth the wait". This is great and extremely flexible.

carboyau
Автор

Congrats python for improving on an old concept in a new and innovative way! It was worth the wait for the switch statement to see this!

theweirdsquid
Автор

Finally! I've been missing switch statements in Python

lizoeshub
Автор

MISTAKE IN THIS VIDEO

You don't NEED to use an underscore. You can AND SHOULD use any valid variable name to capture the value for later use, such as if you want to include the value in a raised error.

The reason the underscore is used is that sometimes you will not need to access that variable after capturing it and in python tools (flake8, pylint, pylance, mypy), the underscore doesn't raise a warning if the variable is never accessed as any other variable name will.

dqalombardi
Автор

ohh What a nice video it is! Thanks for every information. match and switch statements are more useful than if and else. We can already use these instead of those and it prevent to repeat the same things. Now we just need to use one of them(match and switch) and It is the easier way to make code in Python in my opinion.

onlyforscience
Автор

Hello everybody and welcome ... Your intro is the best! And content too :)

dawidstaniek
Автор

as a java programmer that uses switch statements all the time. i am very excited.

amir
Автор

Great job Tim!
it's just like He Did developed Python 3.10 version

krsaad
Автор

I love the way you explain, thank you.
This is really powerful stuff specially when we integrate *args and **kwargs, def gonna use the heck out of it

MadPonyInteractive
Автор

union and algebraic data types are cool as hell

erikawwad
Автор

The one feature I thought python lacked and now we have it. I've not been this excited about a new version of a language since VB4 came out.

Honestly I'm hyped over the new "match" statement.

paulmann
Автор

basically an alternative to the if, elif and else statement?

xc
Автор

Nice video, can I use the "match" & "case" statements at one line like the "if" one, also I am not sure why did they add these while we can simply do almost most of it using the "if" statement and get the same result ..

hackerxfn
Автор

I have to say that I wasn't sure that I expected it to be anything hype, but damn - I will probably upgrade right away just to get this feature :D

rice
Автор

Just a few hours ago I finished all the series and then there were none left and a few hours later there it is! Thankyou so much Tim!

mathewsjoby
Автор

Your awesome man. Keep the good work up

aleksandarharalampiev
Автор

I've just started to learn JavaScript and was wondering why python did not have a switch statement... amazing video/explanation, thank you!

jelle
Автор

This is "select case" like in other languages, but maybe more powerful.

gecsus