@@Indentlyhey Federico! Your point is valid, but i don't think it was clear which is why he was trying to help. There is a clear distinction between camelCase and UpperCamelCase, and although he may not have been aware of this, I believe was just trying to help others not get confused.
For decades Pascal case was: "PascalCase" and Camel Case was: "camelCase", but I noticed in the last few years the Python community has started saying that this is Camel Case: "PythonCamelCase". Since there is no ISO or ANSI standard on how things "Must" be named. It is what it is now, the Pythonistas have taken over. ;-)
@@Indently Um no? Why would you even say "camel case" if not to mean "the first letter is capitalized"? Either use "Upper Case" or "Pascal Case", I've literally never heard "UpperCamelCase"
5:39 Came here to finally understand the self reference and how it works, dozens of other explainer videos and random googles later my journey has ended. THANK YOU!!
thanks the video was just awesome learnt so much in just 18 minutes never thought could gain so much clarity about oop in python in such less span of time.
Primeira vez que eu vi uma explicação do que é "self" que eu entendi. Já vi vários vídeos sobre class e parece que os instrutores sempre tem preguiça de explicar e só dizem "a, tem que colocar isso aí, se preocupa não". Obrigado! 😁😁
Great tutorials on this channel. Python slinger since 90s and find your manner of explanation fabulous. Recommending you to those that ask for help. Keep up the great work and thanks for supporting the community!
Could you perhaps cover classes and GUI's, like PyQt6 or TK? How might one structure a class with widget connections and event handling? Thanks for the educational videos. Great work
I've been playing with Tkinter recently and there's some very specific ways of handling the structure of a tkinter app, but once you get the hang of it, it gets easier. Just start looking up a couple tutorials to start with and then I'd try creating custom buttons, and using event binding to achieve better flexibility assigning other functions or actions instead of using "commands" which you'll learn about if you look those tutorials up.
For instance I replicated a push button that changes on click and on release and also plays a sound. I got the idea from a popular online soundboard website. If you use PIL you can work with PNG images easier, but turns out tkinter does not handle alpha values easily, so you need to do some hex to rgba conversions to match image background to root window background.
the convention is a leading underscore, _foo, is private, and all that means is that clients should not use it nor rely on it. and then there is name-mangling (double leading underscore), that merges the instance name a class name so it cannot be accessed by subclasses.
@foo def bar()... is syntactic sugar for: def bar()... bar = foo(bar) class method changes the default arg "self" to "type(self)" or "self dot dunder class".
@Indently • PascalCase: Commonly used for class names in Python (PEP 8) and in languages like C# and Java. • camelCase: Commonly used for variable and function names in JavaScript, Java, and other languages (though snake_case is preferred for variables and functions in Python)... In the first line of video, you said that in Python we use camelcCase which is wrong..
I think this is a good point, since you can create class variables that are the same in every instance of the class. For anyone learning it's pretty simple to make the mistake of using a class variable think it works the same as an instance one
Is the infromtaion (like brand, power_rating) private like in C#? Do you also need to have get and set methods for the information to use it outside the class?
Python doesnt really have a concept of private/public attributes. You can use hints, but they are not enforced. Getters and setters are not necessary, but afaik they are not mandatory in any language, it's just recommended in OOP for various reasons.
Beautiful... BTW when thou said Initializer ... thou meant constructor ? And how do we know what return type to give functions ? like when to use None and when to use "Str".
4:07 ? how come the instantiation works here? here it seems attributes are somehow set by : (colon) operator but not the = (equal sign) operator In Python, when you instantiate an object, you use the = operator to assign the object to a variable, and the arguments inside the parentheses should be in the form of key=value, not key: value. How does the compiler accept this notation?? edit: time stamp added to question.
@@SirusStarTV A-ha! So, the grayed-out bits are NOT really typed or involved here in 4:07 code BUT just shown but shown by the editor. Do I get it right?
Oh man, i am new to coding and let me tell you, i have no clue what i typed when i was trying to copy what Indently did at the start with the initialisers... also i missed a space after def so the whole code failed at first hahaha
I think you did too much in one video.. Everything from 11:50 onward about dunder methods could have been saved for another video with more detailed explanations.
Actually camelCase starts with a lower case letter. Class names are in PascalCase,
Upper Camel Case and PascalCase are synonyms. I didn't say "UpperCamelCase" but the idea is clear :)
@@Indentlyhey Federico! Your point is valid, but i don't think it was clear which is why he was trying to help. There is a clear distinction between camelCase and UpperCamelCase, and although he may not have been aware of this, I believe was just trying to help others not get confused.
For decades Pascal case was: "PascalCase" and Camel Case was: "camelCase", but I noticed in the last few years the Python community has started saying that this is Camel Case: "PythonCamelCase". Since there is no ISO or ANSI standard on how things "Must" be named. It is what it is now, the Pythonistas have taken over. ;-)
@@Indently Um no? Why would you even say "camel case" if not to mean "the first letter is capitalized"? Either use "Upper Case" or "Pascal Case", I've literally never heard "UpperCamelCase"
@@Indently Holy cow, just say you were wrong tool - do not recommend this channel.
5:39 Came here to finally understand the self reference and how it works, dozens of other explainer videos and random googles later my journey has ended. THANK YOU!!
This contains the clearest explanation of self and what it is/does that I have seen on YT. Thank you!
Thank you for this video - I struggled so hard to understand classes but now I finally got it!!!
I never could understand oop now I really feel like it clicked. Thanks for the life lesson.
I was watching CS50-Python, OOP and I didnt understand anything. Was soooo confused. Now its all clicked. Thank you so much !
thanks the video was just awesome learnt so much in just 18 minutes never thought could gain so much clarity about oop in python in such less span of time.
You are a great teacher! Thank you for sharing these concise tutorials. I've learned a lot!
learned the difference between repr and str dunder. thanks.
do a video about when NOT to use classes, people love to create unnecessary classes
can’t agree more
You could do a part 2 where you explain inheritance and other OOP concepts applied in Python.
I do not comment often but now I do. Because your way of teaching is impressed me. Thanks
Primeira vez que eu vi uma explicação do que é "self" que eu entendi. Já vi vários vídeos sobre class e parece que os instrutores sempre tem preguiça de explicar e só dizem "a, tem que colocar isso aí, se preocupa não". Obrigado! 😁😁
Your videos are amazing. Very well structured and clear, thank you!
Helpful tutorial! Crystal clear. Please continue!
Great tutorials on this channel. Python slinger since 90s and find your manner of explanation fabulous. Recommending you to those that ask for help. Keep up the great work and thanks for supporting the community!
Classes are just TYPE's! That sums it all up in just 4 words... Simples (:-)
10/10 explanation of POOP
I enjoyed these class video.. enough said. To boost my class usage and confidence
This is very helpful, we need more like this!
6th one, I have been following your tutorial, I love how you make it easy to learn classes for real
This topic should include a follow-up at least on class inheritance.
Could definitely make video on that :)
Why not jump right ahead and do a video on why composition is preferable to inheritance?
@quitchiboo I guess because he already said all he knows about it "Python OOP in 20 minutes"
9:15 Oh, so thats the script who whispered it! I thought thats my cat that learnt to talk, and I started praying to him already.
Could you perhaps cover classes and GUI's, like PyQt6 or TK?
How might one structure a class with widget connections and event handling?
Thanks for the educational videos.
Great work
I've been playing with Tkinter recently and there's some very specific ways of handling the structure of a tkinter app, but once you get the hang of it, it gets easier. Just start looking up a couple tutorials to start with and then I'd try creating custom buttons, and using event binding to achieve better flexibility assigning other functions or actions instead of using "commands" which you'll learn about if you look those tutorials up.
For instance I replicated a push button that changes on click and on release and also plays a sound. I got the idea from a popular online soundboard website. If you use PIL you can work with PNG images easier, but turns out tkinter does not handle alpha values easily, so you need to do some hex to rgba conversions to match image background to root window background.
Idk if that helps you but tkinter is kinda fun once you just get started
Great video, easy to understand 👍
Man this is good, thank you very much!
As a Red Dwarf fan, "smeg" is not a word I associate with microwaves!
It really helped me, thanks !
That was incredible
Basic and easy!
Thanks ❤❤❤
So helpful 🎉🎉
very educational, thx!
I wish you'd toched upon access modifiers like private/public in Python and what conventions are used for these.
the convention is a leading underscore, _foo, is private, and all that means is that clients should not use it nor rely on it.
and then there is name-mangling (double leading underscore), that merges the instance name a class name so it cannot be accessed by subclasses.
Great videos with clear expectations thank, please explain classmethods and decorators .
@foo
def bar()...
is syntactic sugar for:
def bar()...
bar = foo(bar)
class method changes the default arg "self" to "type(self)" or "self dot dunder class".
nice one!
Is there a VS code extension that writes "brand:" and "power_rating:" in lines 7 and 12 at 5:55 for python ?
Nice tutorial
Thanks!
Great video !!! i was learning basics then got confused about OOP but this video cleared my confusion out.
good and clear
Very helpful
I would like to understand Inversion of control or Dependency injection from python
4:07 how did he Highlight Brand: and Powerrating: in Grey?
I REALLY like the way you explain EVERYTHING! Soooo many videos leave stuff out, that should be explained!!!
@Indently • PascalCase: Commonly used for class names in Python (PEP 8) and in languages like C# and Java.
• camelCase: Commonly used for variable and function names in JavaScript, Java, and other languages (though snake_case is preferred for variables and functions in Python)... In the first line of video, you said that in Python we use camelcCase which is wrong..
excellent
thank you
You sometimes do not clearly differentiate between the class and the instance. You say 'class' a few times when you meant 'instance'
I think this is a good point, since you can create class variables that are the same in every instance of the class. For anyone learning it's pretty simple to make the mistake of using a class variable think it works the same as an instance one
Do you have video about type annotation? Use it or not what is benefit pls
Yeah, if you search for Indently type annotations a lot of videos should show up!
@@Indently thanks for the video’s! 🤗
love from brazil
do a video about super and inheritance. I am struggling and i understand what you are saying
All youtube tutorials sticks on either Car or Animal example
Coming from c, what do i need to unlearn to understand python
What about all OPP pillars like Inheritance, Polymorphism etc.
Is the infromtaion (like brand, power_rating) private like in C#? Do you also need to have get and set methods for the information to use it outside the class?
Python doesnt really have a concept of private/public attributes. You can use hints, but they are not enforced. Getters and setters are not necessary, but afaik they are not mandatory in any language, it's just recommended in OOP for various reasons.
Python should never have get and set methods, ever, for attributes. Rather, use the property() decorator.
Can you do one of these for NumPy?
Can you make a dunder method? Or you can only use the ones that python gives you?
you killed 7 of my brain cells by calling a non camel case a camelCase.
Beautiful... BTW when thou said Initializer ... thou meant constructor ? And how do we know what return type to give functions ? like when to use None and when to use "Str".
Init and str are strongly typed, you can’t return anything else.
The actual constructor is dunder new. Dunder Init is indeed an initializer.
8:58 so why do we return None on these functions?
It's like "void" in c/c++, it doesn't return anything.
4:07
? how come the instantiation works here? here it seems attributes are somehow set by : (colon) operator but not the = (equal sign) operator
In Python, when you instantiate an object, you use the = operator to assign the object to a variable, and the arguments inside the parentheses should be in the form of key=value, not key: value.
How does the compiler accept this notation??
edit: time stamp added to question.
You see that they're grayed out, right? It's code editor feature that shows the names of arguments for convenience.
@@SirusStarTV A-ha! So, the grayed-out bits are NOT really typed or involved here in 4:07 code BUT just shown but shown by the editor. Do I get it right?
What font is this?
First one
Do decorators next
Also what does '...' (3 dots) in class def means? what happens if given like that?
If you want to quickly make a class or method that doesn't contain any implementation you put three dots ...
If I were you, I would use enums in the power rating section.
Oh man, i am new to coding and let me tell you, i have no clue what i typed when i was trying to copy what Indently did at the start with the initialisers...
also i missed a space after def so the whole code failed at first hahaha
😍😍😍😍
What editor is this?
I guess it's PyCharm 🤓
inheritance isnt oop now?
microwaved smegma
Let's be honest, python object oriented programming is POOP
Does that mean I have to flush the objects to save memory?
@@jerryhall5709 😭😭😭💀💀💀
In the UK __init__ does not work. You have to type __innit__.
I can do this in Rust, C++, and Zig 🗿
3rd one
Very instructive, but you've clearly never used a microwave...
XD Learn how to make A microwave . Thank you
Pretty poor explanations. Do better!
7th
This Video is Sponsored by SMEG.
MA
I think you did too much in one video..
Everything from 11:50 onward about dunder methods could have been saved for another video with more detailed explanations.
5th
Maybe cốt lõi là bik chắt lọc
Smeg
50 Cent
too simple.
Great videos with clear expectations thank, please explain classmethods and decorators .