Hey Fred - You never fail to amaze your students. You are such a gifted teacher who can simplify anything and everything. Big kudos to you.
@mathbyteacademy Жыл бұрын
Thank you so much!
@warrenmarkham8891 Жыл бұрын
Am excited to watch this when I get the chance.🎉
@Ilya_Akchurin Жыл бұрын
Oh! I can't resist to write a comment here! It was a very deep dive in dataclasses! Perfect material! Thank you very much!!!
@mathbyteacademy Жыл бұрын
glad you liked it, thanks!
@FirasShamasnehM Жыл бұрын
You are the best Fred, thank you very much for sharing your knowledge
@mathbyteacademy Жыл бұрын
You're welcome!
@butterhalves4262 Жыл бұрын
Even before starting the video I know that it's going to be awesome. Kudos Fred ! Would love a series on implementing various design patterns using python.
@mathbyteacademy Жыл бұрын
Thanks!
@drgregoryhouse3979 Жыл бұрын
I just finished the udemy deepdive-1 and now half-way deepdive-2. But could not resist to watch this stand-alone course video right now. This is also a great video with the same level of detail as the deepdive series. Great added value !!! 😀
@mathbyteacademy Жыл бұрын
Glad it was helpful!
@kosmonautofficial296 Жыл бұрын
Amazing video! That is a lot of great information. I thought I knew enough of dataclasses but learned a lot in this video. Thanks!
@mathbyteacademy Жыл бұрын
Glad you liked it!
@fatfrankie Жыл бұрын
Thanks for all the work you do. Your python lectures are best I've seen. Just as a suggestion... you should include a 30 second advert for your udemy courses at the start of each of your KZbin videos. This would help those looking to learn Python as well as grow your Udemy following
@mathbyteacademy Жыл бұрын
Thanks! Glad you like the videos. I do add them to the video description - not sure how people would tolerate a 30 second ad for my courses at the beginning of the videos - maybe I should look into cards instead...
@fatfrankie Жыл бұрын
@@mathbyteacademy Yes, displaying a card which links to an advert video (which gives a comprehensive description of your Udemy courses) is an excellent idea! I think very few people actually read the video descriptions. And experimenting with different approaches, and then analyzing their impact, will help you find the optimal approach. Good luck!
@fatfrankie Жыл бұрын
I think it might even be worthwhile creating a professional avert for your Udemy courses and then running it on KZbin Ads
@JimRohn-u8c Жыл бұрын
@MathByte Academy Fred your courses are some of the best in existence definitely promote them!
@venkys1511 ай бұрын
Hey Fred - your courses are GOLD
@mathbyteacademy11 ай бұрын
Thanks!
@tannguyen_9110 ай бұрын
I happy to hear your familiar voice, I didn't know what's your KZbin channel before
@modikai8507 Жыл бұрын
Great lecture on dataclasees Fred, I especially enjoyed the comparison section with name tuples. Can't wait for the follow up video.
@mathbyteacademy Жыл бұрын
Thanks!
@petervize Жыл бұрын
Thanks!
@mathbyteacademy Жыл бұрын
Thank you Peter!!
@aoihana104210 ай бұрын
Just Excellent!
@mathbyteacademy9 ай бұрын
Thanks!
@StelioStefanov Жыл бұрын
Great explanation
@mathbyteacademy Жыл бұрын
Glad you liked it!
@ashishsaraswat7867 Жыл бұрын
You are amazing Fred. Everytime I open youtube app, I check if you released new video. Awesome explanation. Can you please make videos on Machine learning concepts and maths required for machine learning?
@mathbyteacademy Жыл бұрын
Thank you!
@duke007x3 Жыл бұрын
Hi Fred, thank You for another great content and such explanation. Have a small question. 24:20 You added private attributes x, y and radius. Should we also make them private in all other methods __repr__, __eq__ and __hash__? Because it looks like You did not make them private in those methods and in the video they only private in properties You add.
@mathbyteacademy Жыл бұрын
Best practice is to use accessor methods if present. Sometimes you might want to circumvent the accessor methods and read/write the "private" backing variables, but most often you just use the accessors.
@packetporter Жыл бұрын
Hey Fred, great breadth and depth as always. A question regarding dataclasses sorting 47:15 , would using a __post_init__ method be an alternative to sort using radius and/or euclidean distance, for example ``` @dataclass(order=True) class CircleD: sort_index: int = field(init=False, repr=False) euclidean_dist: float = field(init=False, repr=False) x: int = 0 y: int = 0 radius: int = 1 def __post_init__(self): self.sort_index = self.radius self.euclidean_dist = dist((0,0), (self.x, self.y)) ```
@valentinplechuc5710 Жыл бұрын
Hi Fred, Great video,!! thanks for sharing the "in deep" of things.! I was wondering if sometime in the future you could do some comparison between attrs and dataclasses and when to use one or the other. Big kudos!!
@mathbyteacademy Жыл бұрын
Thanks! Yes, I am currently working on something like that, but it's taking me a while to come up with something that's not just superficial.
@pavelekshin92618 ай бұрын
Thanks! Did you start using dataclass more often? In which cases?
@mathbyteacademy8 ай бұрын
Not really. I use pydantic primarily, but that's because most of the projects I work on already have a dependency on pydantic. Otherwise I might use a dataclass, or maybe just a named tuple.
@vijaysingh-p3x Жыл бұрын
Hi Fred, thanks for creating these wonderful lessons. I am trying to understand how python is letting us allow a dictionary with duplicate keys (minute 23.35) in the video, what 's the explanation here, i was expecting the second circle to overwrite the first entry
@mathbyteacademy Жыл бұрын
Thanks, glad you like them. So dictionaries cannot have duplicate entries. The two objects you see there are different objects (if you could retrieve each one you'd observe that they have a different id, they started life out that way), but because we mutated one of the objects to now be equal (in terms of their == and hash) to the other, the two objects have different id's, but as far as the dictionary is concerned they are the "same" object and things get totally weird. Bottom line, you should not use mutable objects as keys of a dictionary.
@sandeepsingavarapu3839 Жыл бұрын
I love your videos, amazing content in Udemy and KZbin. Any plans of making a playlist on Data Structures and algorithms😀
@mathbyteacademy Жыл бұрын
Thank you, glad you like them. No particular plans on data structures, but I do have a video on deques vs lists coming up next in the channel. I'll keep it in mind!
@RicardoSuarezdelValle8 ай бұрын
To be honest I didnt know about dataclasses so I was just using normal classes with __slots__, but 95% of what dataclasses do I was already doing with inheritance, only had to write the __repr__ and all that once, plus most of the dunder methods are useless. But yeah I will switch to dataclasses to avoid writing the __init__, but thats about it
@mathbyteacademy8 ай бұрын
What do you mean "most of the dunder methods are useless"? You mean like __eq__, __hash__, __gt__, __iter__, __next__, etc? If you think those are useless, may rephrase it to "useless to me", because I can assure you they are very useful and used extensively by Python devs (depending on the circumstances).
@MindfreeLetsgo Жыл бұрын
Hi Fred, will you ever make a course on Udemy about making interesting projects using all different techniques of Python? I would love it!!
@mathbyteacademy Жыл бұрын
I have thought about it many times - but I keep getting stuck on Windows vs Linux/Mac. I don't use Windows at all (haven't touched it in like over a decade), and a lot of the "real" projects I work on involve nix command line tools, including things like Makefiles, bash scripts, ci/cd pipelines, etc. I think a majority of Udemy students are on Windows, so that's why I keep getting stuck :-)
@MindfreeLetsgo Жыл бұрын
@@mathbyteacademy Ohhhh, that sounds more interesting to me now !! I want to learn bash scripts and Makefiles etc and I use Linux. Fred, I really hope that you somehow someway make that course on Udemy eventually. If not, I hope that you make it on youtube member channel so that those who want to learn it pay for it, I will definitely pay for that !
@duke007x3 Жыл бұрын
@@mathbyteacademy Makefiles, bash scripts, ci/cd pipelines sounds really good, can we expect some video on this subject?) By the way what tools do you prefer to use for ci/cd pipelines?
@DifferentialGeometry4 ай бұрын
@@mathbyteacademy Do it for the ones that are on Linux! :). I'm working at Microsoft and we use mainly Linux OS in Azure!
@RicardoSuarezdelValle8 ай бұрын
Im not an expert but I think your size comparisons are wrong. When u do the os.size or whatever, it only gives you part of the info on size, I seem to remember only like the reference to the class or something, i.e. a class with one attr will be the same size apparently as one with 100
@mathbyteacademy8 ай бұрын
Where do I use os.size? I'm looking at the code notebook, and doesn't look like I do. I am well aware of the limitations of os.size.
@RicardoSuarezdelValle8 ай бұрын
@@mathbyteacademy O sorry, maybe you did measured the sizes properly but then the sizes look wrong too because they are too similar. I mean in the table were you compare the sizes and speeds at the end of the video.
@mathbyteacademy8 ай бұрын
So, the library I use handles looking inside objects to get the full memory usage. Why are you surprised that the sizes are too similar? At the end of the day, named tuples are actual classes, dataclasses are well, regular classes, and slots do tend to be more efficient than not, but these are small classes, so i would expect difference to be quite small (in absolute terms), and indeed we can see the slots versions use less memory. The numbers I have in that table make sense to me.