Pythons Object Reference

Sdílet
Vložit
  • čas přidán 28. 08. 2024
  • Looks at the relationship between an object reference and a variable

Komentáře • 18

  • @ParleysWoodedJourney
    @ParleysWoodedJourney Před 2 lety +1

    And here I am watching this playlist in 2022. Recommended to us in r/leanrpython

  • @user-bl4lu4kv3b
    @user-bl4lu4kv3b Před 3 lety +1

    I understood and I am happy to subscribe to your channel because you are a great teacher. Thank you very much.

  • @anzwertree
    @anzwertree Před 10 lety +2

    The object memory model used to give me such a headache. Why is it? What? The hell is going on? I never changed that! LOL, so many nights. So much coffee. So many red bulls. So little sleep. For all new Python developers, for God sake take some time to learn the way Python treats variables through its reference model. The whole pass by reference, pass by value, philosophy doesn't exactly map to Python like you'd think because it depends on an object's mutability. It is worth the investment now. Otherwise you're going to give yourself a brain aneurysm down the road for something simple but difficult to debug.

  • @asmartbajan
    @asmartbajan Před 9 lety

    I know this series is about Python and not JavaScript but it's now clearer to me why chapter 2 of *Eloquent JavaScript* states that variables should be imagined as tentacles instead of boxes.
    eloquentjavascript.net/02_program_structure.html

    • @johnphilipjones
      @johnphilipjones  Před 9 lety

      Hello Wayne,
      There has always been a healthy debate around whether a variable is a value. In my view it depends on the context of the program and is one as an engineer I never get involved in. I always go with a model and if my model works then I am ok with it. However, understanding both sides of the argument is important. I find when in doubt try and think how the program would look in machine code - but then I started out as a machine code programmer.
      Best wishes
      Phil

    • @dimitriosdesmos4699
      @dimitriosdesmos4699 Před 7 lety

      impeccable explanations !!!

  • @maxcapener
    @maxcapener Před 10 lety

    John, this makes immutability very understandable to me. What happens in the execution space model with a different assignment operator such as first_number += 2. I'm struggling to conceptualise it with arrows etc.

    • @johnphilipjones
      @johnphilipjones  Před 10 lety

      I will do a video on this next week.
      Phil

    • @maxcapener
      @maxcapener Před 10 lety

      John Philip Jones You're too kind!

    • @johnphilipjones
      @johnphilipjones  Před 10 lety

      ***** Hello Max,
      The video will be based on a refined model as shown in the following sequence of videos that I recommend you watch first.
      czcams.com/video/DIvTNr_eQrY/video.html
      czcams.com/video/gxTXgsDsifQ/video.html
      czcams.com/video/AaIdperUu-A/video.html
      czcams.com/video/-f7GfXPr8CE/video.html
      czcams.com/video/YfleC1nWM6A/video.html
      czcams.com/video/LTw5-5tx5wg/video.html
      czcams.com/video/NIXtvAH7p6U/video.html
      Best wishes
      Phil

  • @sudhirkaushik4786
    @sudhirkaushik4786 Před 6 lety

    you say that 2 is an object can you please explain that how and for which class object 2 is made please explain in brief sir

    • @johnphilipjones
      @johnphilipjones  Před 6 lety +1

      2 is the object and it an instance of the integer class.

    • @sudhirkaushik4786
      @sudhirkaushik4786 Před 6 lety

      thanks for your reply but can you explain it more clearly i also have confusion,,,,,, can you please make a programme for that for better explanation using 2 as object .and class integer

    • @johnphilipjones
      @johnphilipjones  Před 6 lety +1

      Have a look at the video at the following link:
      www.pythonbytesize.com/video-python-binding-a-name-to-an-object.html
      Best wishes
      Phil

    • @sudhirkaushik4786
      @sudhirkaushik4786 Před 6 lety

      John Philip Jones thanks a lot for this your way of teaching awesome... I request you please make a series on ds and django also

    • @johnphilipjones
      @johnphilipjones  Před 6 lety

      I will put it in the pipeline
      Best wishes
      Phil