Тёмный

New Features In Python 3.10 You Should Know 

Patrick Loeber
Подписаться 269 тыс.
Просмотров 122 тыс.
50% 1

This video shows and explains the most important new features in Python 3.10. The release date was on October 4, 2021.
Get my Free NumPy Handbook:
www.python-engineer.com/numpy...
Article: www.python-engineer.com/posts...
All updates: docs.python.org/3.10/whatsnew...
✅ Write cleaner code with Sourcery, instant refactoring suggestions in VS Code & PyCharm: sourcery.ai/?... *
⭐ Join Our Discord : / discord
📓 ML Notebooks available on Patreon:
/ patrickloeber
If you enjoyed this video, please subscribe to the channel:
▶️ : / @patloeber
~~~~~~~~~~~~~~~ CONNECT ~~~~~~~~~~~~~~~
🖥️ Website: www.python-engineer.com
🐦 Twitter - / patloeber
✉️ Newsletter - www.python-engineer.com/newsl...
📸 Instagram - / patloeber
🦾 Discord: / discord
▶️ Subscribe: / @patloeber
~~~~~~~~~~~~~~ SUPPORT ME ~~~~~~~~~~~~~~
🅿 Patreon - / patrickloeber
#Python
Timeline:
00:00 - Intro
00:14 - Pattern Matching
00:59 - Parenthesized Context Managers
01:12 - strict argument for zip
01:44 - Better error messages
02:29 - New typing features
03:21 - Updates and deprecations
03:43 - Improvements
03:56 - Optimizations
04:37 - Conclusion
----------------------------------------------------------------------------------------------------------
* This is an affiliate link. By clicking on it you will not have any additional costs, instead you will support me and my project. Thank you so much for the support! 🙏

Опубликовано:

 

4 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 195   
@ed-salinas-97
@ed-salinas-97 2 года назад
As someone who tutors people new to Python, those new error messages are golden!
@patloeber
@patloeber 2 года назад
yeah they can be really helpful :)
@JiriPrajzner
@JiriPrajzner 2 года назад
finally, after 30 years :)
@erectlocution
@erectlocution 2 года назад
Yeah this is hands-down the best new feature listed.
@bv-9157
@bv-9157 2 года назад
wow they did add Switch to python finally , thats great
@patloeber
@patloeber 2 года назад
yep finally!
@jxggxr_dxv
@jxggxr_dxv 2 года назад
I'm so glad they got rid of the stubborness. I remember they were discussing about this some time ago and said they don't want it. There's so many situations where a switch case represents the "way-to-go" over the ugly nested IFs.
@AndreasDelleske
@AndreasDelleske 2 года назад
@@jxggxr_dxv Every state machine agrees :)
@FADHsquared
@FADHsquared 2 года назад
@@jxggxr_dxv how about key value pairs.
@a4e69636b
@a4e69636b 2 года назад
I aways thought Guido was against switch-case-like code.
@behnamsalehi9765
@behnamsalehi9765 2 года назад
This video was helpful. Thank you ❤️
@voxelfusion9894
@voxelfusion9894 2 года назад
I've been waiting on pattern matching since it was announced, sweet!
@zacky7862
@zacky7862 2 года назад
I've been using 3.10 since beta test. Switch case statement is really great and other features. Looks like there will be more coming tutorial or tips from you. Thank you so much
@patloeber
@patloeber 2 года назад
thanks! Yes there will be more :)
@Omrot
@Omrot 2 года назад
You mean match/case statement... ;)
@Big_Smirky
@Big_Smirky 2 года назад
Really excited to try out the structural pattern matching. Seems like that has huge potential. And I just know that in the process of trying it out, I'll get to see lots of the new error messages lol 😂
@patloeber
@patloeber 2 года назад
haha yeah :)
@alb12345672
@alb12345672 2 года назад
Looks like C# is starting to rub off on python :lol:
@itslaudy
@itslaudy 2 года назад
Its been a integral part of Haskell for a while now.
@thingsiplay
@thingsiplay 2 года назад
I know the match feature from Rust and it is fantastic. I love it is being added to Python.
@vamsikillamsetti9245
@vamsikillamsetti9245 2 года назад
Really informative. Keep these videos coming!!
@patloeber
@patloeber 2 года назад
thanks, glad you like it :)
@greenhoodie
@greenhoodie 2 года назад
Yes! Improved error messages are a fantastic idea!😁
@patloeber
@patloeber 2 года назад
yep absolutely!
@DennisIvy
@DennisIvy 2 года назад
You are on it! Nice!
@patloeber
@patloeber 2 года назад
thanks :)
@__________________________6910
@__________________________6910 2 года назад
Omg Dennis Ivy is here.
@DennisIvy
@DennisIvy 2 года назад
@@__________________________6910 Chuck Norris learns python from Patrick, and so do I ;)
@__________________________6910
@__________________________6910 2 года назад
@@DennisIvy I also know Patrick.
@Diamond_Hanz
@Diamond_Hanz 2 года назад
Yey...love the heads up.makes me feel nerdy
@patloeber
@patloeber 2 года назад
hehe thanks :)
@ZurioSi
@ZurioSi 2 года назад
Thank you!. Amazing video
@patloeber
@patloeber 2 года назад
thank you!
@FRANKWHITE1996
@FRANKWHITE1996 2 года назад
Thanks for sharing! 👍
@patloeber
@patloeber 2 года назад
glad you like it!
@itprojects1110
@itprojects1110 2 года назад
nice info shared.....thanks
@patloeber
@patloeber 2 года назад
glad you like it, thank you!
@saivamsi9859
@saivamsi9859 2 года назад
Simply Outstanding video 🔥❤️
@patloeber
@patloeber 2 года назад
thank you!
@luis96xd
@luis96xd 2 года назад
Wow, this is so amazing! Python is awesome
@DrewGillen
@DrewGillen 2 года назад
You are awesome! Keep making machine learning videos, I love those!
@patloeber
@patloeber 2 года назад
thank you, I will!
@sunritjana4573
@sunritjana4573 2 года назад
Yay, Really excited for Python 3.10!
@patloeber
@patloeber 2 года назад
me too :)
@leestaton1697
@leestaton1697 2 года назад
good channel and videos i think the new features in python 3.10 are awsome
@supercheetah778
@supercheetah778 2 года назад
The new error messages are awesome! Were those inspired by Rust error messages (they look similar), or something in the works beforehand?
@SsaliJonathan
@SsaliJonathan 2 года назад
NIce video. Engineer. Thanks for the inspiration
@patloeber
@patloeber 2 года назад
glad you like it :)
@Param3021
@Param3021 2 года назад
I like the new match case statement, and the new better error messages which really saves a lot of time in a big code
@patloeber
@patloeber 2 года назад
yep I like them too
@hanimahdi7244
@hanimahdi7244 2 года назад
Thanks!
@mumk
@mumk 2 года назад
so much pattern matching nowadays, nice
@2koolbros154
@2koolbros154 2 года назад
LMAO didn't know that Python 3.10 is releasing so early before I saw your video in my recommendations!Great update and great video. As a C# and C++ dev, seeing case statements being added is a wonderful update.Great Video👍
@patloeber
@patloeber 2 года назад
yep pattern matching is a great addition. Glad you like it!
@aarondewindt
@aarondewindt 2 года назад
This isn't just a case statement like in C# and C++, it's much more. I've been programming in Rust the past few years and pattern matching is much more powerfull than a switch/case.
@2koolbros154
@2koolbros154 2 года назад
@@patloeber LMAO what! First time I got a heart
@2koolbros154
@2koolbros154 2 года назад
@@aarondewindt Yep.Its got a lot of potential. I just experimented with it yesterday.The Python Devs made a great decision by adding them.
@heroe1486
@heroe1486 2 года назад
Details for error messages seems cool, no more headaches with indentation errors when for some reasons your editor's linting and auto format extensions aren't working and you've refactored or c/p some if statements. No need to check line by line if it's 1 pixel to the left/right.
@patloeber
@patloeber 2 года назад
yep :)
@swarajsahoo4060
@swarajsahoo4060 2 года назад
Great video..please provide some more tips about 3.10
@patloeber
@patloeber 2 года назад
thanks! I will :)
@michalski9141
@michalski9141 2 года назад
didn’t know python had switch statements now.. gotta try it out sometime
@python360
@python360 2 года назад
Nice video boss 👍
@patloeber
@patloeber 2 года назад
thank you!
@deldarel
@deldarel 2 года назад
It's been a while since I've really used python, but pattern matching really reminded me why I love it so much
@patloeber
@patloeber 2 года назад
great to hear that :)
@freedom_aint_free
@freedom_aint_free 2 года назад
I liked the 'match' operator and '|' uses as I think that Python should lean more to the functional side (what I think that is the future of the Industry) than the OOP paradigm.
@karx11erx
@karx11erx 2 года назад
I had created a small 3D app with Python as an exercise recently (using pygame, pyopengl and pyopengl-accelerate). Today I installed Python 3.10, built pyopengl and pyopengl-accelerate from the dev branches for it, and ran the app again. With Python 3.9.6, it was around 30% faster (233 fps vs. 164 fps). I was quite surprised, since I had expected the opposite to happen.
@patloeber
@patloeber 2 года назад
Hm yeah this is indeed surprising...
@nowhereman5956
@nowhereman5956 2 года назад
nice changes, Python is getting better and easier.
@patloeber
@patloeber 2 года назад
yes :)
@hariprasathpanneerselvam5361
@hariprasathpanneerselvam5361 2 года назад
Very great, pls make a video about set up pc/ mac for data science
@patloeber
@patloeber 2 года назад
thanks for the suggestion!
@hariprasathpanneerselvam5361
@hariprasathpanneerselvam5361 2 года назад
@@patloeber really many of us don't know how to properly install it, getting error and not able to run machine learning projects
@thomaspfaff1074
@thomaspfaff1074 2 года назад
I already know the match-case command from c++ or c#. I'm glad it's now available in Python as well.
@patloeber
@patloeber 2 года назад
yep great feature!
@ShivamJha00
@ShivamJha00 2 года назад
It's much more Powerful than C++ switch
@danielegvi
@danielegvi 2 года назад
There is no match-case in C++, only switch
@angusyim7395
@angusyim7395 2 года назад
i really like the match cases but ill have to wait a while for libraries to get ported over before i can switch over to 3.10
@patloeber
@patloeber 2 года назад
nice!
@thingsiplay
@thingsiplay 2 года назад
I will upgrade to Python 3.10 (while using Qtile). And to be clear, it is not my decision to upgrade, it is part of the rolling release of Manjaro. Hopefully everything goes right. I am a bit nervous.
@balakumar.n4891
@balakumar.n4891 2 года назад
Brilliant
@patloeber
@patloeber 2 года назад
thanks!
@theecherry9115
@theecherry9115 2 года назад
can you create exactly this type of short video for all 3.x versions? Will be awesome.
@jiunjiunma
@jiunjiunma 2 года назад
very nice
@patloeber
@patloeber 2 года назад
thank you!
@majkelpl8611
@majkelpl8611 2 года назад
The pattern matching reminds me Scala (one of the greatest languages). I'm happy Python finally got that. What's going to be included in next releases, what do you think? I would love to see a lambda operator known from other languages, eg. JavaScript: x => x + 1 Thanks for a great video!
@patloeber
@patloeber 2 года назад
yeah it's nice! Glad you like it :)
@psycholog79
@psycholog79 2 года назад
Well, pattern matching is much older than Scala ;)
@henrivlot
@henrivlot 2 года назад
I'm not sure if you mean improve the lambda operator or implement it, because if it's the latter, you might be surprised to know it's already there! You can do f = lambda x: x+1 and then f(1) will give you 2
@majkelpl8611
@majkelpl8611 2 года назад
@@henrivlot yeah i've meant a concise operator.
@reisaki18
@reisaki18 2 года назад
pattern matching is too old in bash
@alagappank1242
@alagappank1242 2 года назад
Helpful....
@patloeber
@patloeber 2 года назад
thanks!
@sinaorojlo5980
@sinaorojlo5980 2 месяца назад
Nice 🎉
@TK-yu5tt
@TK-yu5tt 2 года назад
I don't have plan to update python on my main device (because some libraries may not work correctly), but I have to try a lot of things on virtual machine.
@patloeber
@patloeber 2 года назад
yep same here
@rafeq
@rafeq 2 года назад
Launch Django tutorial please? Just the simple projects!!
@caio-jl6qw
@caio-jl6qw 2 года назад
What theme were you using in your Python codes?
@patloeber
@patloeber 2 года назад
Material theme in this video
@ghastkid1935
@ghastkid1935 2 года назад
How do i use user input in atom using 3.10?
@weetabixharry
@weetabixharry 2 года назад
Why don't the "old" error messages in this video look like mine? If I have a syntax error, then Python prints 300 lines of black-and-white text, with the actual error hidden somewhere in the middle. What am I doing wrong? Can I configure this somehow?
@ephraimmedina2011
@ephraimmedina2011 2 года назад
if i install 3.10 does all libraries i installed on 3.9 will be lost?
@yairkaz
@yairkaz 2 года назад
0:52 just so you know you can do f"{x=}" and it will do the same as f"x={x}"
@notanenglishperson9865
@notanenglishperson9865 2 года назад
Why do you end the statement with questioning intonation?
@fahmypaiziah2837
@fahmypaiziah2837 2 года назад
I cant install mediapipe in python 3.10, any solutions please?
@tituss1421
@tituss1421 2 года назад
so, i'm still using python 3.8.2 have a couple of things i've been experimenting with and have written some stuff for myself, for fun. Now that I want to update to 3.10, how do i do it? Where is the "Update to latest version" in python? How do i do it and run all my old .py projects without worrying that some modules or some dependencies were not lost along the way? Thank you!
@Khelso
@Khelso 2 года назад
You would have to manage your environments for your old projects. For example, if you created a Tic-Tac-Toe game using Python 3.8.2, create an environment that uses that version of Python and don't update/change that specific environment. This is one of the advantages of Anaconda, if you use conda.
@tituss1421
@tituss1421 2 года назад
@@Khelso Thank you for your answer! I'm not a professional software engineer and i don't code that much but I am a project manager in a software company and seeing the lads use c# and easily updating and not worrying about backward compatibility and all the jazz just makes me feel very sad for python. It's like this language was made to be taken seriously. Just for anyone to make a first step into coding and then move on to something more powerful and better maintained. I know i sound a bit frustrated but i really am. I don't use conda and i don't use jetbrains i just install python and i go with idle, i just like it that way. On linux, i open the console and write my .c programs in vim. I'm not yet at the level when i would find third party "help" useful. Cheers Seth!
@adarshdwivedi6630
@adarshdwivedi6630 2 года назад
Good
@bagoquarks
@bagoquarks 2 года назад
*THE MATCH-CASE* may be a better branching solution if you are staring at an 'ELSEIF' or equivalent in any language's syntax, i.e. 3 or more forks in your IF block with perhaps the need for more to be discovered. I first used it in the '80s in SAS, an early data warehousing product from the SAS Institute. In later years and languages I would start a shell error trap code block and terminate it with the equivalent of a 'case _' block; unhandled runtime errors would emerge during testing and the code would be improved by adding new 'case' blocks to fix or report the error as appropriate. This is a very welcome improvement to Python. Thank you for the overview. I am new to Python and I'm hoping these features are promptly migrated to the Python forks being maintained for microcontrollers.
@toyin5522
@toyin5522 2 года назад
With keyword like Pascal
@akshaysrivathsa227
@akshaysrivathsa227 2 года назад
Can u please make a general video on how to make a game ai with pytorch.
@patloeber
@patloeber 2 года назад
you mean like this one? ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-5Vy5Dxu7vDs.html
@akshaysrivathsa227
@akshaysrivathsa227 2 года назад
@@patloeber yeah
@johnstoner2
@johnstoner2 2 года назад
i just tried, but numpy isn't ready. soonn, though, i have a bunch of code that would be much better with match.
@thebigboi5357
@thebigboi5357 2 года назад
Great video! Some criticism though - your audio is quite jarring when wearing headphones because the gate is too aggressive.
@patloeber
@patloeber 2 года назад
Thanks for the feedback! I try to fix it
@subramanivasu3458
@subramanivasu3458 2 года назад
I think at 0.49, Case 3, it should be x={x}. Nevertheless, a great video. Thank you =)
@patloeber
@patloeber 2 года назад
you are right, thanks for the hint :)
@trag1czny
@trag1czny 2 года назад
@@patloeber in general it'd probably be the best to use {x=} tho
@woolfel
@woolfel 2 года назад
finally accurate error messages. Why did it take soooo long for that finally get implemented?
@jyvben1520
@jyvben1520 2 года назад
only took 30 years, working speed was more important, ever tried Ada, those compile errors ... 😎
@ShivamJha00
@ShivamJha00 2 года назад
Ever tried C++?
@woolfel
@woolfel 2 года назад
@@ShivamJha00 good point. I tried C++ and then thought "nope, no thanks. I don't want to manage pointers." Then it triggered all sorts of memories of linux stuff doing a core dump.
@saurrav3801
@saurrav3801 2 года назад
I didn't know the new release of python....before I watch your video
@patloeber
@patloeber 2 года назад
Now you know ;)
@dominion2734
@dominion2734 2 года назад
Feiner Mann!
@alexandertsiolkovski5848
@alexandertsiolkovski5848 2 года назад
I recently installed python 3.10 and I am having trouble PIP (or PIP3) installing any of the libraries. They take forever and then error out. Has anyone been experiencing this? How do I fix this?
@keco185
@keco185 2 года назад
Not all libraries are probably updated to support 3.10 just yet. With python, it's typically easier to just stay 1-2 version behind.
@zacky7862
@zacky7862 2 года назад
Still no final release. Still this latest version on their website. Python 3.10.0rc2 - Sept. 7, 2021
@patloeber
@patloeber 2 года назад
now it's out :)
@zacky7862
@zacky7862 2 года назад
@@patloeber Finally! Thanks
@SuperlativeCG
@SuperlativeCG 2 года назад
It has taken on a life of its own.
@ac130kz
@ac130kz 2 года назад
the unfortunate thing about this pattern matching is the lack of actual lookup table, it's matching EVERYTHING sequentially just like elifs
@patloeber
@patloeber 2 года назад
yeah it works a little bit different than switch/case, but matching for patterns can be powerful on the other hand
@mawkuri5496
@mawkuri5496 2 года назад
cant install machine learning libraries...:(
@SkyFly19853
@SkyFly19853 2 года назад
Nice! I hope they also make progress in Panda3d, Pygame, and Cython.
@patloeber
@patloeber 2 года назад
I'm sure they will :)
@SkyFly19853
@SkyFly19853 2 года назад
@@patloeber Yes, I am looking forward to. I know Python has so much potential for video game development.
@UloPe
@UloPe 2 года назад
Who are „they“?
@SkyFly19853
@SkyFly19853 2 года назад
@@UloPe The developers, of course.
@UloPe
@UloPe 2 года назад
@@SkyFly19853 ah yeah of course, those guys…
@RohanSomadder
@RohanSomadder 2 года назад
Does anyone know about how to update libraries in older version of python like python 3.7 , 3.8 , 3.9 when all these are simultaneously installed in the pc with python 3.10. Btw , very nice video sharing such information glad to watch it ❤️
@patloeber
@patloeber 2 года назад
you don't really update single libraries in older versions, you just install the complete new version. but you can have multiple python versions installed separately. then you probably want to work with virtual environments and make sure to activate the python version you want
@RohanSomadder
@RohanSomadder 2 года назад
@@patloeber Thanks , helped me a lot 🤟
@jklasfjkl
@jklasfjkl 2 года назад
the features are great, but can't upgrade if the dependencies don't allow it :(
@adeshmishra1671
@adeshmishra1671 2 года назад
Love you😅🛸🙂
@patloeber
@patloeber 2 года назад
haha, thanks :)
@pratikdhande826
@pratikdhande826 2 года назад
How to update python 3.7 to 3.10 in system,
@patloeber
@patloeber 2 года назад
you can directly download and install it from the official homepage. or you use a package or version manager like anaconda/homebrew/pyenv
@Anonymous-hc5kp
@Anonymous-hc5kp 2 года назад
Now the Union is very best one.
@tigidou3344
@tigidou3344 2 года назад
why keep decoration window like macOS ....
@MCalvert69
@MCalvert69 2 года назад
Sorry for the stupid question, but I'm very new to Python. Very. But my conda is running 3.9 something. so 3.10? What am I missing? Thanks
@luziferius3687
@luziferius3687 2 года назад
You are missing that CPython 3.10 is released _today_ . So it’ll take time to be packaged for conda and other package managers.
@patloeber
@patloeber 2 года назад
yeah as soon as it is available you can create a new conda environment, e.g. by saying "conda create -n py310 python=3.10"
@niteshbabu5731
@niteshbabu5731 2 года назад
Finally... Switch is here... 🙌 Don't know why they changed it to match..🤔
@patloeber
@patloeber 2 года назад
because it's a little bit different than switch/case. it's a little bit more powerful since you can match whole patterns and not just single values.
@danielegvi
@danielegvi 2 года назад
It's a feature in many other languages. It's more powerful and much more ergonomic than a switch, while still being able to do everything a switch does. As an example, switch has fall-through in many languages, and you must add a break statement for the most part. Match statements do away with that and instead use the "|" operator to create patterns. That's why they're called "pattern matchers", and that's where "match" comes from.
@__________________________6910
@__________________________6910 2 года назад
Great
@patloeber
@patloeber 2 года назад
thank you :)
@alexeyabashev829
@alexeyabashev829 2 года назад
LOL It took only 30 years to add switch/case...
@patloeber
@patloeber 2 года назад
better late than never ;)
@Ajay_Pathak_
@Ajay_Pathak_ 2 года назад
Match case is much intuitive than switch case , ha ha .
@patloeber
@patloeber 2 года назад
you think so?
@Ajay_Pathak_
@Ajay_Pathak_ 2 года назад
@@patloeber yuuuppp Although switch case literally makes sense But match case... It's just better !
@basic086
@basic086 2 года назад
OMG State machines in Python, f***-ing finally!!
@patloeber
@patloeber 2 года назад
hehe :)
@Kappe619
@Kappe619 2 года назад
I rember my first day learning Python. Sytax error? What? Why?? Any ; missing??? Better error messages are great for beginners!
@patloeber
@patloeber 2 года назад
they are :)
@JR-ly6bx
@JR-ly6bx 2 года назад
I cant see anything on your screen, why dont you zoom in so people can follow along
@NavySturmGewehr
@NavySturmGewehr 2 года назад
C# > Python
@RiteshNEVERUNIFORM
@RiteshNEVERUNIFORM 2 года назад
Id only use it if it comes ith anaconda. Having anaconda makes sure you are having a stable set of most the tools you will require
@patloeber
@patloeber 2 года назад
yeah anaconda is a good way to manage your environments :)
@SirGisebert
@SirGisebert 2 года назад
They hugely improved the error messages and you won't even mention this as #1? Do you even work with python? :D Jokes aside, I'm so much looking forward to using all these new features. It's like christmas, just better.
@patloeber
@patloeber 2 года назад
shame on me :D It is indeed a great improvement :)
@isaacyn8256
@isaacyn8256 2 года назад
How does someone dislike the video??
@patloeber
@patloeber 2 года назад
hehe I don't know ;)
@TomStorey96
@TomStorey96 2 года назад
@@patloeber They must be a Rust programmer.
@foobar1269
@foobar1269 2 года назад
Don't agree with zip name. Why not call it join instead
@samyesuraj6605
@samyesuraj6605 2 года назад
I dont know why your voice is cool....
@bryce-bryce
@bryce-bryce 2 года назад
German
@tonycstech
@tonycstech 2 года назад
Still no easy way to compile python into windows executable ? How do they expect it to be Windows friendly if its including interpreter with every compiled script instead of compiling it to C or C# ? Its 2021 already and all they did was to fix the error messages to point out where the error is ? This is some slow and Ef'ed up development team.
@tinpot1978
@tinpot1978 2 года назад
You talk funny
@truongnv84
@truongnv84 2 года назад
What Is Blockchain?
@bryce-bryce
@bryce-bryce 2 года назад
Geiler scheiß
@patloeber
@patloeber 2 года назад
haha danke!
@Thomas-vd7ez
@Thomas-vd7ez 2 года назад
using the word "match" instead of "switch" is idiotic. every other commenter here refers to it as switch statements. why be different from every other programming language? I hate that
@patloeber
@patloeber 2 года назад
yes that's a fair point!
@arthurbohn3161
@arthurbohn3161 2 года назад
Because switch-case is for a single value, while match-case is for patterns. Switch-case is a subtype of match-case
@Thomas-vd7ez
@Thomas-vd7ez 2 года назад
@@arthurbohn3161 unless this new version of python provided both the "switch" and "match" keywords, you answer still doesn't justify having to learn yet another language specific keyword IMO.
@arthurbohn3161
@arthurbohn3161 2 года назад
@@Thomas-vd7ez This is not Python specific, other languages use it too (Haskell, Scala, Rust). Pattern matching (match-case) is way more powerful than switch-cases, while can also be used in the same way switch-cases do. This adds a lot of flexibility to Python, and makes the if-elif-else pattern obsolete.
Далее
10 Python Comprehensions You SHOULD Be Using
21:35
Просмотров 124 тыс.
15 Python Libraries You Should Know About
14:54
Просмотров 370 тыс.
10 Python Basics You Should Know!
10:08
Просмотров 78 тыс.
Python 3.12 is HERE!
12:37
Просмотров 156 тыс.
You Are Going To Like These New Features In Python 3.11
10:58
How to create a great dev environment with Docker
29:55
11 Tips And Tricks To Write Better Python Code
11:00
Просмотров 604 тыс.
Python 3.12 release: The BIGGEST in 15 years
8:05
Просмотров 48 тыс.
6 Tips to write BETTER For Loops in Python
9:19
Просмотров 246 тыс.
Top 18 Most Useful Python Modules
10:50
Просмотров 925 тыс.
5 Useful Dunder Methods In Python
16:10
Просмотров 54 тыс.