Pointers in Python Are A Real Thing

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 ธ.ค. 2024

ความคิดเห็น • 37

  • @janbielecki94
    @janbielecki94 2 ปีที่แล้ว +10

    When you showing the example with id(a) == id(b) at the beginning you could briefly explain the "Python Integer Caching" concept.

  • @3komma141592
    @3komma141592 ปีที่แล้ว +1

    Very nice video 👍
    The example where "a=literal; b=literal" results in "a is b" only works for "small" literals. I tried it out in Python 3.11.4 and it worked in the range [-5, 256].
    "a=257;b=257;a is b" will return false. It is also a CPython implementation detail.

  • @thisoldproperty
    @thisoldproperty 2 ปีที่แล้ว +1

    I really appreciate these advanced tips! Thanks

  • @kcvinu
    @kcvinu 2 ปีที่แล้ว +1

    Hi, how to pass the pointer of a python class(self pointer) to a c function and retrieve it from another c function ? I mean SetWindowLongPtr and GetWindowLongPtr.

  • @jakfrost7367
    @jakfrost7367 ปีที่แล้ว +1

    3:22 tf..... why is it acting like that with lists...... i wish they remove this list behaviour in future versions

  • @1mrnewton
    @1mrnewton 2 ปีที่แล้ว

    I just love the beat of your intro too😇😂

  • @SuitedforSuccess
    @SuitedforSuccess 2 ปีที่แล้ว +1

    The neuralintents library isn't working i try the exact same code as your

  • @MyriadColorsCM
    @MyriadColorsCM 2 ปีที่แล้ว +1

    Next thing you´re going to tell me is that I can do manual memory management with Python using some weird module.
    I can´t...RIGHT? Oh god, now that I think about it, something like "import Malloc" might just be something that actually exist.

  • @bariscanbilgin
    @bariscanbilgin ปีที่แล้ว

    A great video Sir, thanks a lot!

  • @christiankoch4627
    @christiankoch4627 2 ปีที่แล้ว +30

    The question is why should i use pointers in python?

    • @lhard123l
      @lhard123l 2 ปีที่แล้ว +1

      Thats good question

    • @lack_of_awareness
      @lack_of_awareness 2 ปีที่แล้ว +6

      If you want indirection

    • @broccoloodle
      @broccoloodle 2 ปีที่แล้ว +4

      They are not pointers in python, they’re just pointer in c.

    • @tcgvsocg1458
      @tcgvsocg1458 2 ปีที่แล้ว +1

      that was my question but its intersting to know anyway

    • @jose6183
      @jose6183 2 ปีที่แล้ว +4

      I guess it depends on the case. If you are building a special data type or class there might be a use case. I think it's probably a better idea to use them in C i think if you want to debug wrappers, maybe it's useful as well.

  • @EigenA
    @EigenA 11 หลายเดือนก่อน

    B[0] = 100
    Print(a)
    Just hurt my soul for some reason. Why did that update ‘a’ and not an independent copy of ‘a’ that had been initialized during the statement ‘b=a’?

  • @duftcola
    @duftcola 2 ปีที่แล้ว +1

    Would this increase performace or it wont make any difference

    • @Lucas-yh5zz
      @Lucas-yh5zz ปีที่แล้ว

      The main use of the ctypes module is to provide compatibility with libraries and programs written in C, it may or may not be faster but it's general purpose isn't to improve performance

  • @tcgvsocg1458
    @tcgvsocg1458 2 ปีที่แล้ว +3

    i think for this year neural nine is the best youtuber with "grafikart" and 'codetalker9408' so thx a lot for all the video you share...
    do you have an example that you can use this or is just thing we know but not using?

  • @paulthomas1052
    @paulthomas1052 2 ปีที่แล้ว +1

    Thanks - very useful. :)

  • @jeffbezos5479
    @jeffbezos5479 9 หลายเดือนก่อน

    What about the python pointer library?

  • @syedshakerhussaini1390
    @syedshakerhussaini1390 2 ปีที่แล้ว

    Well explained 😇👏

  • @cagauravmonga0825
    @cagauravmonga0825 2 ปีที่แล้ว +1

    Which IDE does he is using?

  • @ВисалИнг
    @ВисалИнг ปีที่แล้ว

    So u meant that python always deterrence that pointer behind the scenes ?

  • @abdullashafi580
    @abdullashafi580 2 ปีที่แล้ว +1

    pls DSA playlist bro : (

  • @user-KR0mpi
    @user-KR0mpi หลายเดือนก่อน

    NICE

  • @stevenwilson5556
    @stevenwilson5556 2 ปีที่แล้ว

    I missed where this ability was useful? I get you have the ability to monkey around with pointers and their contents but… why?

  • @Djellowman
    @Djellowman 2 ปีที่แล้ว +1

    I fail to see a use case for this

    • @brhh
      @brhh 2 ปีที่แล้ว +1

      me too, makes c looks easier :\

  • @mage1over137
    @mage1over137 2 ปีที่แล้ว

    Well yeah everything is literally one

  • @wesleyoliveira6570
    @wesleyoliveira6570 2 ปีที่แล้ว

    Cool

  • @guilherme5094
    @guilherme5094 2 ปีที่แล้ว

    👀!!