A Python Variable versus a Python Object

Sdílet
Vložit
  • čas přidán 4. 12. 2013
  • Looks at a Python variable with specific reference to an object and its object reference.

Komentáře • 19

  • @35utab35
    @35utab35 Před 4 lety +8

    Your videos make things crystal clear. This level of clarity is something I have never seen so far in any of the books or courses. Great work and many thanks for your efforts ;-)

  • @louistiches9774
    @louistiches9774 Před 7 lety +9

    I can't tell you how many videos I have watched that started will declaring variables in Python. I was so confused when I started reading a book that was calling them objects and not variables. Thank you, this video was a great help for me.

  • @prakritiadhikari2347
    @prakritiadhikari2347 Před rokem +2

    amazing videos and explanations. visualisations always helps and stays in mind for longer so thanks for the effort. greatly appreciated

    • @johnphilipjones
      @johnphilipjones  Před rokem

      Thank you for your positive comments it is appreciated
      Best wishes Phil

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

    Simply excellent pedagogical teaching video. Techniques of learning re-inforcement, repetition of concepts, clarity with respect to each referent (object even) you are discussing. No ambiguity (Well, wait. Did he mean this or that?) Just clarity, clarity clarity in a topic fraught with the possibility, even probability of misunderstanding. You really get inside learners' head. That is so great. You can't get this anywhere. But then you knew that. I just don't understand why you don't have more views. I would have thought that this kind of clarity, which is so rare, would generate throngs of people pushed to your CZcams channel through sheer frustration or desperation. There are some things I will never understand. Like Ricki Martin or Neil Diamond. Sheesh!

    • @johnphilipjones
      @johnphilipjones  Před rokem

      Thank you for your positive comments it is appreciated.
      Best wishes
      Phil
      (John Philip Jones)

  • @grobknoblin5402
    @grobknoblin5402 Před rokem +1

    These videos are incredible! You make it so understandable I paid for courses that don't have an ounce as much clarity as this!! I just have to ask is this python 2 or 3 though?

    • @johnphilipjones
      @johnphilipjones  Před rokem +1

      Thank you for the positive comments it is appreciated. The videos cover Python 3. I would be greatful if you could share links to the videos via social media.
      Best wishes
      Phil

  • @confidential303
    @confidential303 Před 8 lety +1

    Does this apply for all programming languages? In Assembly you create a variable by assigning the memory where you want to store it. In my opinion, if you know where the address is of the variable, then if you read the memory address you should read the value, but if i am right you are saying the variable contains the referency memory instead of the value?

    • @johnphilipjones
      @johnphilipjones  Před 8 lety

      +confidential303 No it does not apply to all programming languages. You describe machine code correctly (my background is machine code programming) but it is best not to try to relate Python to machine code. Of course it is machine code that ultimately runs when you compile high level languages.
      Regards
      Phil

    • @confidential303
      @confidential303 Před 8 lety

      +John Philip Jones great! I have done electical engineering and coded in assembly I am missing it ..like to work on low level programming :D though it is a while back.

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

      confidential303 I occasional still work in machine code when accessing peripheral devices but only for fun. Drivers these days are very efficient. However, I have found when teaching programming those who have a machine code background make better programmers. I did electronic engineering so I may be biased.
      Best wishes
      Phil

  • @justgivemethetruth
    @justgivemethetruth Před 8 lety

    this is good ... but how does the system know what kind of data the object reference is pointing to?

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

      +justgivemethetruth Python does not have variables in the traditional sense. It has names that are bound to values. The values have the type not the name. So the values can be integer, float, string etc.
      Phil

    • @srinidhiskanda754
      @srinidhiskanda754 Před 7 lety +1

      it will know at runtime when object is created. every python object has a header called designator that will decides what the value type is. This is also called DYNAMIC Typing. So type of variable knows only at runtime after object created. hope this helps.

    • @justgivemethetruth
      @justgivemethetruth Před 7 lety +1

      srinidhi skanda - you just left me this response that I can no longer find ...
      '' it will know at runtime when object is created. every python object has a header called designator that will decides what the value type this is also called DYNAMIC Typing value type. So type of variable knows only at runtime after object created. hope this helps. ''
      Yes, that helps a lot. I'd like to know where do you find and learn this level of detail about Python, the internals so to speak, in a way that is understandable. I recall a UNIX Internals class I took that enlightened me as to know languages, in this case C works internally with the stack, heap, BSS, etc, and I would love to delve into Python at such a level - though it has been a long time since I have studied computer science per se.
      Thanks for your comment.

  • @SunilPatel-fv5qq
    @SunilPatel-fv5qq Před 6 lety

    do object reference and object id same?

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

      Think of the id as the address of the object in memory and is therefore the reference to the object. For CPython this is the case for the other 'flavours' of Python I am unsure.
      Best wishes
      Phil