Learn Python OOP in under 20 Minutes

Поділитися
Вставка
  • Опубліковано 21 лис 2024

КОМЕНТАРІ • 100

  • @susieoneil5706
    @susieoneil5706 2 місяці тому +161

    Actually camelCase starts with a lower case letter. Class names are in PascalCase,

    • @Indently
      @Indently  2 місяці тому +31

      Upper Camel Case and PascalCase are synonyms. I didn't say "UpperCamelCase" but the idea is clear :)

    • @Obie.
      @Obie. 2 місяці тому +47

      ⁠@@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.

    • @stevehageman6785
      @stevehageman6785 2 місяці тому +7

      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. ;-)

    • @JelloTalks
      @JelloTalks 2 місяці тому +8

      @@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"

    • @GRAYgauss
      @GRAYgauss 2 місяці тому +4

      @@Indently Holy cow, just say you were wrong tool - do not recommend this channel.

  • @SuperWombus
    @SuperWombus Місяць тому +6

    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!!

  • @angelinaradovanov47
    @angelinaradovanov47 8 днів тому +2

    Thank you for this video - I struggled so hard to understand classes but now I finally got it!!!

  • @HariWiguna
    @HariWiguna 3 дні тому

    You are a great teacher! Thank you for sharing these concise tutorials. I've learned a lot!

  • @reginamndii
    @reginamndii 3 дні тому

    I was watching CS50-Python, OOP and I didnt understand anything. Was soooo confused. Now its all clicked. Thank you so much !

  • @JosephAgwuh-p3b
    @JosephAgwuh-p3b 3 дні тому

    I enjoyed these class video.. enough said. To boost my class usage and confidence

  • @vinesnts
    @vinesnts 2 місяці тому +16

    You could do a part 2 where you explain inheritance and other OOP concepts applied in Python.

  • @canewizard4141
    @canewizard4141 2 місяці тому +3

    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! 😁😁

  • @dingdongkornik9521
    @dingdongkornik9521 2 місяці тому +4

    learned the difference between repr and str dunder. thanks.

  • @gustavos3424
    @gustavos3424 2 місяці тому +26

    do a video about when NOT to use classes, people love to create unnecessary classes

  • @kspen72
    @kspen72 Місяць тому +6

    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!

  • @ferroalloys594
    @ferroalloys594 Місяць тому +1

    Classes are just TYPE's! That sums it all up in just 4 words... Simples (:-)

  • @huseynxayyati2355
    @huseynxayyati2355 2 місяці тому +1

    Great videos with clear expectations thank, please explain classmethods and decorators .

  • @ferggill9461
    @ferggill9461 2 місяці тому +10

    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

    • @lowerclasswarfare
      @lowerclasswarfare 2 місяці тому

      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.

    • @lowerclasswarfare
      @lowerclasswarfare 2 місяці тому

      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.

    • @lowerclasswarfare
      @lowerclasswarfare 2 місяці тому

      Idk if that helps you but tkinter is kinda fun once you just get started

  • @yoyoiziah
    @yoyoiziah 2 місяці тому +2

    Your videos are amazing. Very well structured and clear, thank you!

  • @MrNess2911
    @MrNess2911 2 місяці тому +2

    Helpful tutorial! Crystal clear. Please continue!

  • @NedTrevor
    @NedTrevor 2 місяці тому

    6th one, I have been following your tutorial, I love how you make it easy to learn classes for real

  • @romaniannationalist9167
    @romaniannationalist9167 10 днів тому

    It really helped me, thanks !

  • @twilightop
    @twilightop 2 місяці тому +1

    This is very helpful, we need more like this!

  • @hamzahalli3500
    @hamzahalli3500 Місяць тому +1

    Great video, easy to understand 👍

  • @dr4k0nis
    @dr4k0nis 2 місяці тому +18

    This topic should include a follow-up at least on class inheritance.

    • @Indently
      @Indently  2 місяці тому +12

      Could definitely make video on that :)

    • @quitchiboo
      @quitchiboo 2 місяці тому +6

      Why not jump right ahead and do a video on why composition is preferable to inheritance?

    • @samuelec
      @samuelec 2 місяці тому

      @quitchiboo I guess because he already said all he knows about it "Python OOP in 20 minutes"

  • @spacelem
    @spacelem Місяць тому +3

    As a Red Dwarf fan, "smeg" is not a word I associate with microwaves!

  • @KM_CM
    @KM_CM Місяць тому +3

    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.

  • @PHTM04
    @PHTM04 2 місяці тому +1

    Basic and easy!

  • @Skubidi-qy8hb
    @Skubidi-qy8hb 2 місяці тому +1

    Great video !!! i was learning basics then got confused about OOP but this video cleared my confusion out.

  • @afiffarakhan4992
    @afiffarakhan4992 Місяць тому

    Man this is good, thank you very much!

  • @apeared9491
    @apeared9491 Місяць тому

    do a video about super and inheritance. I am struggling and i understand what you are saying

  • @BonesFrielinghaus
    @BonesFrielinghaus Місяць тому

    I REALLY like the way you explain EVERYTHING! Soooo many videos leave stuff out, that should be explained!!!

  • @amirabas8817
    @amirabas8817 2 місяці тому

    Thanks ❤❤❤
    So helpful 🎉🎉

  • @dhilip77
    @dhilip77 2 місяці тому +1

    I would like to understand Inversion of control or Dependency injection from python

  • @Jblanco1989
    @Jblanco1989 Місяць тому

    Very helpful

  • @skywalker0823
    @skywalker0823 Місяць тому

    good and clear

  • @carry_boats
    @carry_boats 2 місяці тому

    very educational, thx!

  • @jeffreyndukwe3869
    @jeffreyndukwe3869 2 місяці тому +1

    Nice tutorial

  • @LoL-hv6px
    @LoL-hv6px Місяць тому +2

    All youtube tutorials sticks on either Car or Animal example

  • @wahwahwally1
    @wahwahwally1 2 місяці тому +1

    nice one!

  • @mreddy7356
    @mreddy7356 Місяць тому

    excellent

  • @KumR
    @KumR 2 місяці тому

    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".

    • @DrDeuteron
      @DrDeuteron 2 місяці тому +1

      Init and str are strongly typed, you can’t return anything else.
      The actual constructor is dunder new. Dunder Init is indeed an initializer.

  • @VrishabhBansod
    @VrishabhBansod 2 місяці тому

    What about all OPP pillars like Inheritance, Polymorphism etc.

  • @kanishkashami
    @kanishkashami 2 місяці тому

    Do decorators next

  • @eeshtarr
    @eeshtarr 2 місяці тому +20

    You sometimes do not clearly differentiate between the class and the instance. You say 'class' a few times when you meant 'instance'

    • @EUJokerBR
      @EUJokerBR 2 місяці тому

      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

  • @yungc0c0_
    @yungc0c0_ 2 місяці тому

    Can you do one of these for NumPy?

  • @playgoods
    @playgoods 21 день тому

    thank you

  • @Luca-lz4io
    @Luca-lz4io Місяць тому

    love from brazil

  • @slimestaff1
    @slimestaff1 Місяць тому

    Can you make a dunder method? Or you can only use the ones that python gives you?

  • @neebftw
    @neebftw 27 днів тому

    Do you have video about type annotation? Use it or not what is benefit pls

    • @Indently
      @Indently  27 днів тому +1

      Yeah, if you search for Indently type annotations a lot of videos should show up!

    • @neebftw
      @neebftw 26 днів тому

      @@Indently thanks for the video’s! 🤗

  • @Anat20081
    @Anat20081 2 місяці тому +1

    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?

    • @quitchiboo
      @quitchiboo 2 місяці тому +1

      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.

    • @DrDeuteron
      @DrDeuteron 2 місяці тому

      Python should never have get and set methods, ever, for attributes. Rather, use the property() decorator.

  • @yeloSolo
    @yeloSolo 29 днів тому +1

    you killed 7 of my brain cells by calling a non camel case a camelCase.

  • @dimmudimmu8512
    @dimmudimmu8512 2 місяці тому +1

    Coming from c, what do i need to unlearn to understand python

  • @kadircalloglu2848
    @kadircalloglu2848 2 місяці тому

    If I were you, I would use enums in the power rating section.

  • @poopilydoopily7784
    @poopilydoopily7784 Місяць тому +4

    microwaved smegma

  • @arungumpina4644
    @arungumpina4644 Місяць тому

    Also what does '...' (3 dots) in class def means? what happens if given like that?

    • @SirusStarTV
      @SirusStarTV Місяць тому

      If you want to quickly make a class or method that doesn't contain any implementation you put three dots ...

  • @schwartzenheimer1
    @schwartzenheimer1 54 хвилини тому

    Very instructive, but you've clearly never used a microwave...

  • @BunrithViwatthanak
    @BunrithViwatthanak 22 дні тому

    I can do this in Rust, C++, and Zig 🗿

  • @sorenschultz1144
    @sorenschultz1144 2 місяці тому +2

    Let's be honest, python object oriented programming is POOP

    • @jerryhall5709
      @jerryhall5709 28 днів тому +1

      Does that mean I have to flush the objects to save memory?

    • @sorenschultz1144
      @sorenschultz1144 28 днів тому

      @@jerryhall5709 😭😭😭💀💀💀

  • @MewingStreak31
    @MewingStreak31 Місяць тому

    inheritance isnt oop now?

  • @erkakb
    @erkakb 2 місяці тому

    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
      @SirusStarTV Місяць тому +1

      You see that they're grayed out, right? It's code editor feature that shows the names of arguments for convenience.

    • @erkakb
      @erkakb 12 днів тому

      @@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?

  • @mamuli01
    @mamuli01 Місяць тому +1

    This Video is Sponsored by SMEG.

  • @johnmoff9324
    @johnmoff9324 2 місяці тому

    What editor is this?

    • @AriteZastrow
      @AriteZastrow 2 місяці тому +1

      I guess it's PyCharm 🤓

  • @rainy20202
    @rainy20202 Місяць тому

    8:58 so why do we return None on these functions?

    • @SirusStarTV
      @SirusStarTV Місяць тому

      It's like "void" in c/c++, it doesn't return anything.

  • @secrontory1346
    @secrontory1346 2 місяці тому +1

    7th

  • @shiva_1947
    @shiva_1947 2 місяці тому

    😍😍😍😍

  • @deequi77
    @deequi77 2 місяці тому

    3rd one

  • @harshjain2171
    @harshjain2171 2 місяці тому +1

    First one

  • @HungryBen-d7y
    @HungryBen-d7y 2 місяці тому

    5th

  • @leFrederic
    @leFrederic 3 дні тому

    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.

  • @striderdubz8440
    @striderdubz8440 29 днів тому

    Smeg

  • @Hopetobebetter
    @Hopetobebetter 16 днів тому

    too simple.

  • @huseynxayyati2355
    @huseynxayyati2355 2 місяці тому +1

    Great videos with clear expectations thank, please explain classmethods and decorators .