Memory Diagrams in Python

Поделиться
HTML-код
  • Опубликовано: 16 ноя 2024

Комментарии • 13

  • @daveyutz3942
    @daveyutz3942 Месяц назад

    Go heels! Literally sitting in Davis right now and came upon this video haha

  • @patricepreudhomme5533
    @patricepreudhomme5533 3 года назад +1

    Thanks a lot, I have been learning Python with an online paying platform for one year and no one explained this. Always the basic and understand the background before to jump on frameworks and so on.....

  • @_BYR47
    @_BYR47 2 года назад +2

    I think this exactly what I was looking for!! I’m stuck on python it’s hard for me to describe it but it’s like I have this understanding of how the program works I have all the basics down like list strings int inputting flows of, if else, Boolean etc. slowly struggling with classes modules & objects but I know that they all coincide with each other like I have this picture or diagram that I can’t draw out from my mind that will help me better understand how this whole language and all languages on there own intertwines with itself, and would help me fully inner-stand. haven’t watched the video hope this is it tho.

  • @guneetmalhotra01
    @guneetmalhotra01 Год назад

    Can't belive i have found this golden content. Thanks Kris.

  • @ryanyan3563
    @ryanyan3563 3 года назад

    One thing can be improved in the diagram is the value should be drawn on the heap, e.g. x = 4, x is on the stack where the 4 is on the heap

    • @KrisJordan
      @KrisJordan  3 года назад

      While technically more accurate in the context of Python specifically, the intent of these models is to be reasonably generalizable such that when you think through a language such as Java you have a more familiar understanding. Since int/float/str are immutable, maintaining references in the diagram is conceptual overhead at the level we're aiming for. I appreciate the specificity, though, because your are correct!

  • @FaisalAkhtar
    @FaisalAkhtar 4 года назад +1

    What a fantastic video. Its surprising that it is not higher in the results.

    • @KrisJordan
      @KrisJordan  4 года назад +1

      Thanks Faisal! I really like the idea of your one minute video series. It's great to have quick, bite sized introductions and refreshers available as you're learning how to program.

    • @FaisalAkhtar
      @FaisalAkhtar 4 года назад

      @@KrisJordan Thanks

  • @thile4089
    @thile4089 3 года назад

    At first they sounded really intimidating but now I think it’s easy peasy thanks to you! :) I still have one question though, how do we put
    if __name__ = “__main__”:
    main()
    in our memory diagram?

  • @wonderfulworld1128
    @wonderfulworld1128 4 месяца назад

    I'm not understanding why we need to store function definition in heap, when all of work has to be done in stack memory???

    • @KrisJordan
      @KrisJordan  4 месяца назад +1

      @@wonderfulworld1128 functions can be passed as arguments to other functions and references to their heap definitions are what get passed around (in Python). There's nothing special about the main function in Python, you can write it to return values of you'd like.

    • @wonderfulworld1128
      @wonderfulworld1128 4 месяца назад

      @@KrisJordan sir your mean to say that whenever a function def encounterd in python script python holds the name in global stack frame and it's reference is hold in the heap memory... Whenever a function is called in script a new call stake frame initialzed in stake memory and all its variables and values stores in that particular frame. My question is that when this function returning a value let say 4(immutable type) or any function inside (not been called yet), the value has to be gone to the the caller end.. and reference has been hold by the any variable let say num_result... but the return value where gone in the stack memory or heap memory?? And also the function we'd returned the definition of insided , where it gone?? Because I know whenever return statement encountered call stacks is removed and the reference it hold in heap it's all gonna be removed..sir please give me some examples to understand what's going in memory when all of this kind stuffs happens in code?? As you shared in this video like that, I would be very happy to learn something in detail???