Комментарии:
Too bad my camera decided to switch off near the end. It probably couldn't handle the awesomeness of structural pattern matching 😎.
ОтветитьGreat video. One huge opportunity is to follow the functional programming patterns of returning tuples of values from functions and matching results. Eg. function `def do_foo()` returns (ok: bool, reason: str, data: dict) . By using structural pattern matching you can write cleaner and intuitive invocation code. Once I get my code base moved up to 3.10+, I'll be using this heavily. T hanks for the great videos!
ОтветитьNeat!
Ответитьcool video thx, maybe a side by side comparison of the 3.10 and the previous version would be nice.
ОтветитьFantastic video!
ОтветитьWatering your flower
ОтветитьBest tutorials on Structural pattern matching....
Thanks 🙏🙏🙏
After this tut, dev will use it for complex it-else,
Waiting for V2 of it, with regex & using async task group on functions part of each case
Thanks!
Ответитьwhat a great implementation of the classical Switch statement offering much versatility. As i am not a big fan of the argparse module, this certainly makes my life easier in the future.
ОтветитьCan you match by type and tuple, sorta like Scala's match?
ОтветитьGreat content. Very helpful for new Python programmers.
ОтветитьI have learned more from 10 arjan videos that i have from any other source on python. another great video this.
ОтветитьActually, you don't need to import typing List and use more convenient and beginner-friendly 'list[int]' syntax!
ОтветитьIn the first example why did you use the ! in the "other" case?
ОтветитьCan someone explain how the pipe character is used in python? It seems like Arjan is using it here as a logical OR, but I can't seem to get that functionality out of it in other settings.
ОтветитьCan this be used for factory pattern?
ОтветитьVery nice feature. Thank you
ОтветитьWhat does the !r do in the string interpolation?
ОтветитьWhat's that "other!r"? I don't recognise that use of the exclamation mark or what the r does.
Ответитьgreat job Arjan
Ответить¡Gracias!
ОтветитьNice video. Don't you think adding OOP in the "run_command_v4 function is a bit overkill?
ОтветитьHi! I have just been introduced to your channel and I wanted to ask - how shall I navigate your videos from more like beginner level to advanced? Do you actually have videos for python beginners? Thank you!
Ответитьpatten matching before fixing recursion? meh
ОтветитьVery interesting. For the object pattern matching, is it actually instantiating a new object for every case check? Wondering whether this would have performance implications for classes with expensive constructors.
Ответитьwhat is difference between using IF/ELIF and case?
Ответитьyour videos are always very interesting. thank you !
ОтветитьIn v4, why did you use command as the variable for the match statement along with command being an element of the Command class? Doesn't overuse of the word command like that muddy the water for anyone reading it?
ОтветитьCamera accidentally switches off
Arjan: Sorry for the camera, I'll try to put a positive spin on it.
Me: Finally! Me and my ADHD brain can actually focus on the code being written, instead of constantly getting distracted!
Wished I have this channel so much earlier in my career!!
ОтветитьNeat! One more question please, i think you didn’t said it explicitly; okay the case has an order importance, but if i dont qui the program as you do with quit() , may i go by many case or only one is possible as the elif statement ? Thanks i hope i could currently use python 3.10 its dope!
ОтветитьPlease, tell me you can implement duff's device in Python! XD
ОтветитьGreat tutorial @arjan. One question. In your first example, you used None to mention the return type of the methods without any return. Is this the standard/preferred way? I don't really mention it if there is no return. Thank you.
ОтветитьGiven how slow python execution, other than compiled libraries is, is there much point optimising it? Is it just a glorified launch platform for C++ code? It is beyond my imagination why it's become the go-to for tensor processing, it makes no sense. Perhaps it's indicative of an even starker divide between people that program for the machine and people who just want predetermined things immediately
ОтветитьSwitch statement in python 🤔?
Can't we do the same with dictionary
Thanks, man! Very clearly explained!
ОтветитьI've learned that switch/case statements have their place in factory methods where different inputs lead to the creation of different classes. I think that's where this tool might become useful as well because you don't depend on switching over a primitive value like a string or an int.
ОтветитьI'm pretty new to this channel. Is that some inside joke you put on the wall (STRUCTURAL MATTER PATCHING)?
ОтветитьSwitch case in python is something that I've been waiting for so long. Your tutorials are amazing by the way.
ОтветитьQuestion. at 9m34 looking at version 3 of the command. Comparing the "with --force" case with the "no force", the print statements are different, but the next command is quit() in both cases. Not seeing how the behaviour will actually be different.
ОтветитьThe best structural pattern matching tutorial I've watched.
ОтветитьStructural Matter Patching
ОтветитьIs this the new best way to keep track of states in an application?
ОтветитьLearned Scala 5ish years ago and starred working with it, since then I get deja vu every time I see a new feature of another language being released.
Ответить