Dynamic Attribute Handling in Python: getattr(), setattr(), hasattr(), delattr()

Поділитися
Вставка
  • Опубліковано 1 лип 2024
  • Today we learn how to dynamically handle and manage Python object attributes.
    ◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
    📚 Programming Books & Merch 📚
    🐍 The Python Bible Book: www.neuralnine.com/books/
    💻 The Algorithm Bible Book: www.neuralnine.com/books/
    👕 Programming Merch: www.neuralnine.com/shop
    🌐 Social Media & Contact 🌐
    📱 Website: www.neuralnine.com/
    📷 Instagram: / neuralnine
    🐦 Twitter: / neuralnine
    🤵 LinkedIn: / neuralnine
    📁 GitHub: github.com/NeuralNine
    🎙 Discord: / discord
  • Наука та технологія

КОМЕНТАРІ • 18

  • @bedtime_RL
    @bedtime_RL Рік тому +6

    Just to add to the content, getattr can also work with methods inside class. Let’s say you got a Bot class with a method named display, you can use getattr(Bot(), “display”)() to dynamically call the methods.

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

    Clear and to the point. Awesome stuff! 🚀

  • @gamerk88
    @gamerk88 5 днів тому

    Is'nt the comments for this video are less MAN I mean he explained everything so nicely..

  • @teprox7690
    @teprox7690 Рік тому

    sehr schöner Content!

  • @paulthomas1052
    @paulthomas1052 Рік тому

    Thanks very useful.

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

    Thank you ❤

  • @youssefalkhodary
    @youssefalkhodary Рік тому

    Perfect

  • @scarysticks66
    @scarysticks66 Рік тому +1

    Neuralnine have you tried Mojo?

  • @mmurray4043
    @mmurray4043 Рік тому +4

    NeuralNine should be renamed NeuralTenOutOfTen. Thank you for this great video

  • @SolidBuildersInc
    @SolidBuildersInc Рік тому +1

    This was a jewel. I am more comfortable with Functional Programming with Pandas. Trying to have a RAD flow with OOP has been very challenging for me. This was the missing link. How or Can the OOP be a dataset to sync with a DB?
    I never understood how the OOP Devs managed the data efficiently. To me, it seems like if the server goes down they lose all of the data because it wasn't a DB. Maybe it was a DB, but this is my delima.
    Anyway,
    Thanks for sharing 🎉

  • @A.A.Selwy-77
    @A.A.Selwy-77 Рік тому

    interesting .

  • @kutilkol
    @kutilkol 3 місяці тому

    Your head morphed into gta san andreas character

  • @ruzibayevich1693
    @ruzibayevich1693 Рік тому

    I wanna cry, why my tech hasn't taught that 😢

  • @vishnubalaji9500
    @vishnubalaji9500 Рік тому

    guys you can also use self.__dict__['key'] to add , change , remove or find if class attributes exists. It works similar to globals() and returns a dictionary of class attributes.

  • @shafininja7
    @shafininja7 Рік тому

    Bro I want to learn subprocess

  • @tcgvsocg1458
    @tcgvsocg1458 Рік тому

    its good video please don t show your face

    • @tr5946
      @tr5946 3 місяці тому +1

      Wrong

  • @cawkcheck
    @cawkcheck Рік тому

    man your voice tone has changed a bit. you okay?