Python Iterators! COPY or NO COPY?

แชร์
ฝัง

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

  • @gloweye
    @gloweye ปีที่แล้ว +131

    Footnote: Several functions, like reversed(), actually have a dunder they check for first. If an object knows how to reverse itself more efficiently, they should implement it. Reversed will check for a __reversed__ method and use __getitem__ and __len__ as a fallback if there is none.

    • @EmoonX
      @EmoonX ปีที่แล้ว +18

      Funny to see TH-cam converting dunders to sunders + _italics_ .

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

      The TH-cam commenting system is crap.

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

      this is not dunder

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

      \_\_getItem__

    • @bakedbeings
      @bakedbeings ปีที่แล้ว +7

      It looks like escaping the underscores with a backslash works.. but doesn't hide the backslash. Let's see what grave/backtick does:
      `__getItem__`

  • @TotalTimoTime
    @TotalTimoTime ปีที่แล้ว +73

    I would like to mention that PyCharm and the entire JetBrains suite is free for students and teachers (even the professional versions). Just make an account and verify your education in your account setting and you should get validated within a day or two. Enjoy this great set of IDEs!

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

      They're doing the drug dealer strategy: get you hooked on it so you'll pay then when it's no longer free.

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

      Really, free? I dont remember it being gpl

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

      @@adriansiska4612 can’t confirm GPL but for most students I don’t think it matters. It is definitely able to be downloaded an used with no cost though

  • @alexismandelias
    @alexismandelias ปีที่แล้ว +5

    The cool thing with numpy is that array dimensions are also accounted for using strides. So a 2x4 array and a 1x8 reshaped version of it differ only at their "stride" and "shape" attributes. That's why it's so efficient to reshape numpy arrays. Also obligatory #pyplease

  • @talshafir10
    @talshafir10 ปีที่แล้ว +11

    You always bring up the sharpest corners and edges of Python, things that most didn’t think of or were too lazy to check, and I LOVE it!
    Thanks for you work and happy new year?

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

    This channel is pure gold, I am amazed that you have such a small number of subscribers!

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

    #pyplease
    Currently studying for my bachelors in Computer Science and mCoding along with a few other channels have become a routine visit. You're able to explain specific topics with incredible ease and its simple enough for a 10 year old to understand. Been in love with this channel since I found it and just want to ask you to never stop making Python explanations.
    Thank you so much!

    • @martinc.7424
      @martinc.7424 ปีที่แล้ว

      Don't need a license apparently

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

    I already used python with non professional purposes since 15 years, yet your clean presentations and explanations of topics made me learn more and quicker than many courses and documentation reading I ever had.
    Keep up with the good work: you are as far as I could search the web (which I did a lot regarding python), the best content creator for python programming. On the contrary, there are a lot of amateurs doing (spreading) damage out there!
    #pyplease

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

    Easily, hands down, best Python channel on TH-cam 👏👏👏

  • @pokedart9001
    @pokedart9001 ปีที่แล้ว +9

    #pyplease
    Long time viewer, first time commenter - I really like the way you make simple explanations of relatively advanced or low-level topics in (mostly) Python! I often come back to some of these videos to try and reference the topics covered and show them to my friend with whom I’ve been co-authoring a Python Discord bot, and it’s been insanely helpful. I think my favorite one of these might be where you talk about multiprocessing in Python - that’s always a topic that I am both very interested and very confused about no matter what programming language it’s for. Thanks a lot for making these videos, and I look forward to seeing more!

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

    I was always surprised as to what made a copy and didn't. I love your videos because you present the info in a through manner without dragging out the videos. #pyplease

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

    Your videos are fantastic. You have a very deep understanding of the language and it’s great that you share it

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

    This helps so much when doing leetcode and wanting to improve just a bit more memory usage.

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

    Most of this I knew, but bits of knowledge like this are so useful when writing Python.

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

    at 6:50 ...
    for char in list(d.keys()):
    d[char.upper()] = d[char]
    works without copying any data beyond the keys, it just hits the hash table more, but if you are going to run out of memory converting to a list, who cares.

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

    After watching several of your videos to help me learn and understand Python, I've finally been accepted and am going back to school for my BS in Computer Science. Thank you for all your help! #pyplease

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

    Nice, as usual. The last example I'd have used `tuple(d.items())`, since a tuple is more lightweight and faster to construct.

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

      d.update((k.upper(),v) for k,v in d.items())

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

      @@MrMeztar So true!

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

    It's nice to get a glimpse of how the built-in methods work in Python. I look forward to more videos like this.
    #pyplease

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

    First,. this is really insightful, thanks for that. Second, correct me if I'm wrong, but ther iterators __iter__ method doesn't HAVE to return ITSELF, but its return value must be an object which implements __next__, and it's that object's __next__ method which is called every iteration. The actual object can be whatever you need it to be. I built an application a while ago where __iter__ got data from a database, and then returned a new custom iterator object from that. Obviously returning self is the typical usecase, but not the only one!

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

    #pyplease Awesome video!
    I didn't know that was the reason dictionaries forbid changing sizes during iteration. I always thought it was done merely as a safe-guard for uncareful users. But it makes sense now considering lists allow to append to themselves during iterations.
    Also, personally I like calling ".copy" explicitly instead of exhausting the items iterator so people would figure the intention behind it.

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

      +1 for explicitly do copy() - for readability and clueless colleagues

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

      at 6:50 ...
      for char in list(d.keys()):
      d[char.upper()] = d[char]
      works without copying any data beyond the keys, it just hits the hash table more, but if you are going to run out of memory converting to a list, who cares.

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

    #pyplease
    I can never get enough of learning new things. I'm always on the lookout for new information and you always seem to know exactly what I need to learn. It's like you have a sixth sense for the things I'm interested in.

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

    Wow, honestly, this is new to me... I thought reversed() makes a copy! But thanks for pointing out how to 'try to detect' if something makes a copy or not, albeit in Numpy's situation, the method doesn't work 😄
    Basically all library creators/maintainers should indicate whether a function/method makes a copy or not in their documentations...
    #pyplease

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

    Been programming in Python for a long time now, and the fact that l[::-1] makes a copy really surprised me.
    Also, when in doubt, use the id() function.

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

    #pyplease
    I didn't know the answer before watching the video, however it is what I intuitively thought how it works.
    I think if it would automatically copy, the operation would unnecessarily slow down the computation and add memory peaks that are not necessary in most use cases, defeating the point of iterators. However, since it doesn't, there might be some usecases, but a) those rarely happen and b) they can be easily fixed by a `.copy()` if the programmar is aware of.
    One detail to mention of the implementation, the following code:
    x = [1, 2, 3]
    y = reversed(x)
    x.add(4)
    print(x)
    print(list(y))
    Will print [1,2,3,4] [3,2,1]
    This is due to the class implementation, computing n at the __init__, therefore it reverses the first 3 elements of x, no matter how x changes over time.
    You only see that it doesn't use copy when altering the first three elements:
    x = [1, 2, 3]
    y = reversed(x)
    x[1] = 5
    print(x)
    print(list(y))
    Will print [1,5,3] [3,5,1]
    Or inserting elements:
    x = [1, 2, 3]
    y = reversed(x)
    x.insert(1, 5)
    print(x)
    print(list(y))
    Will print [1, 5, 2, 3] [2, 5, 1]

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

    Thank you James, that was helpful!

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

    #pyplease Always very high quality and advanced/interesting python content. BTW, How is it you have not yet done a collab with Grant from 3Blue1Brown? He wrote manim module, or you can provide some input on it or have discussions about Knuth's permutation algorithm and it discrete math results for that. Best success for 2023 James. #pyplease

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

    #pyplease
    Great video! Really informative and well explained. You always dive deep into how Python works and its really helpful to better understand the language!

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

    I didnt tought slicing would make a copy. As always ure video made me learn something new. keep up the good work #pyplease

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

    #pyplease
    This was definitely the hardest concept for me to grasp when I started doing more advanced things in python with much larger runtimes. Python is so well optimized that there's a deceptive sense of how efficient your code is for small datasets. I never realized how inefficient my code was until I started working with million by million sized arrays of data and realized how important knowing exactly how each built-in handles your dataset is.

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

    #pyplease
    I had no idea what numpy was doing behind the scenes, awesome

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

    I like watching your content and your explanations of the inner workings of the python library. My C/Fortran brain doesn't always like the concepts from Python. But at least you make the crusty bits I don't like digestible and give me an insight into why it doesn't do what I want. :)
    #pyplease

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

    #pyplease I thought I knew everything here, but I didn't expect numpy array slices not to make a copy, although it makes so much sense. Thanks!

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

    Funny that the slice syntax actually makes a copy, so it is a pessimization of your reverse solution. But IIRC this is not the case in numpy, as it just creates a new "view" of the same underlying memory chunk. Edit: whoops, the video already says that!
    Speaking of slices, maybe you could do a video on them? (If you haven't done that already ofc)

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

    #pyplease
    Great stuff as always. You're video about setting up automated testing for a python project is one keep coming back to.

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

    #pyplease Explaining more advanced Python concepts and be that clear is an art!

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

    Awesome video. Hey mCoding have you thought about doing any videos on Rust? Im starting to learn Rust for 2023 and so far its pretty cool language. Takes a lot of things i like from C++ and Python. Just wondering if you have any plans to delve into the Rust ecosystem. Anyway keep up the great content and hope 2023 is full of it.

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

    Once more delving into the depths of Python. #pyplease

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

    #pyplease
    Nice explanation! Thank you!
    One suggestion for future video: underrated stdlib functions

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

    I click the youtube notification and select the like button as soon as the video begins playing ❤

  • @shneor.e
    @shneor.e ปีที่แล้ว

    #pyplease Great timing I just realized I was making a copy of the string with str[idx:] and changed it with a range loop, it seems like that increaseed the performance by alot

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

    #pyplease
    Excellent video. I enjoyed the deep dive into how things really work in Python.

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

    #pyplease
    Your channel is a gold mine for people trying to get into programming and I love it ! This video especially clarifies some points I wasn't sure about while doing API requests where I need to iterate on some data in my current project!

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

    #pyplease
    Thanks for another great video. Short and sweet, always to the point.

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

    Thanks for all the great informative and concise content you make!! #pyplease

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

    #pyplease
    Love the channel. Thanks for tipping me off to reverse(), which is definitely the (immutable) way to go!

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

    #pyplease been enjoying your content. I'm a python developer, some things I already know, but many quirks you reveal are new and sometimes even get introduced into my habits. When I'm looking for performance, I turn to C Bindings and read tutorials and articles until I have my bindings working properly, but it's a huge slow down in development. What do you think of numba or rust as new technologies to bring performance to commonly used code?

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

    i think, unless one needs a copy explicitly, or participates in a code challenge, they should stick to readability. Yes, as a Py Programmer i know what 'data[::-1]' means, but it takes a bit more time to process this in my brain.
    'reversed(data)' is also faster to understand/read for new people. And it prevents typos! If you forget the minus, you just have a un-reversed copy. Or if you forget one colon, you suddenly have a one-shorter list. For someone reading and/or writing as lot of code, you may just overlook it.
    Saving a few characters today in a file is nonsense. Disk pace is plenty. And since it's mainly symbols some diffs just may produce ugly results (yes, veeery specific, i know)
    I know having to "unlearn" a "bad habbit" is hard, I don't want to offend those folks. But some people are... "quirky". If you need those vew chars because your formatter otherwise makes it ugly, you should reformat/extract/etc more around it, than by "over-micro-optimizing".
    If you need a rev-copy this way - add a comment why. Otherwise replace it, if you stumble over one. One may argue, that 'list(reversed(data))' may also be ""safer""
    Also, remember the Zen:
    "...Explicit is better than implicit.
    ...Readability counts.
    ..."
    still, I wish y'all a happy new year

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

    This is tricky specially for beginners in python (not necessarily only in programming).
    Generators can be used to stack operations for lazy evaluation only when data is truly necessary. This may be or may not be what you want. This also means that you may choose to copy data along the way to flush a bunch of operations and then start consuming back from there.
    A comment on numpy, I think the video missed to mention that although data inside the container itself is not being copied, the variables will point to different memory addresses ( id (a)!=id (b) ) because getitem will return a viewer over the data with different parameters.
    Since I'm here. Why not? #pyplease

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

    #pyplease
    I have learned so much advanced topics and core python internals watching your all videos! I'm a subscriber ever since you had just over 5K subs.. Love to see the success and growth of your fantastic channel and explanations. Thanks so much!

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

    #pyplease
    I remember that in some languages such methods might have annotations or something like that, indicating if they are modifying, copying or just "viewing" the original object. Those annotations are then shown in IDEs when hovering the method.

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

    I thought that reversed(), filter(), etc. created a copy. Thanks for the video. #pyplease

  • @rabin-io
    @rabin-io ปีที่แล้ว

    #pyplease
    It is always nice to learn how Python handles this kind of optimization under the hood.
    Thanks again for a great explanation video.

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

      Just remember that this is just simmilar implementation, not real one, also the real one may very between majnor releases.

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

    Huh, the slicing has been my go-to method for forever. I'm going to keep reversed in mind in the future. #pyplease

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

    yes this is extremely useful for me

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

    Great video as always, #pyplease

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

    > I'm coding in Python
    > mCoding releases video
    > I watch video
    > I see how I should've done it
    > Delete project
    > It's fine cuz I can get a better version of my IDE by commenting something with #pyplease in it

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

    It's interesting how Cython handles it.
    I think it's mostly the same way since it uses the same libcpython, but I'll try to check it out.

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

    PyCharm is hands down the best IDE for Python so #pyplease let me win 🥳
    Clearly that's why these videos give the best hints and explanations about all things python 👍🏼👍🏼

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

    #pyplease Thanks for diving into these details of Python. As an amateur, it's really helpful to know how things work behind the scenes.

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

    #pyplease Interesting info about builtin functions making a copy or not. Python iterators are powerful!

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

    I'm still learning python, this is awesome stuff #pyplease

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

    #pyplease
    Great video. As someone who is slowly trying to learn rust, python iterators being lazy made so much sense after I revisited them with some rust knowledge.

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

    As a newbie programmer I made my linked list __iter__ a generator, which seems to work fine with next(). Is there a reason why this shouldn't be done?

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

    #pyplease Great video as always! I always learn something new from you.

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

    I remember it took me ages to find my first mistake regarding pass by reference before actually knowing about the existence of it :D #pyplease

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

    You showed how reversed works when it's given a sequence as an example, that it uses it's length to start from the end. But how would that example work when you pass an iterator to reversed, since iterators aren't sized. It would have to have access to the original sequence which may be hidden behind a bunch of lazily evaluated iterators in order to tell it to start evaluating all of those lazy iterators from the end. If this isn't done then the whole input iterator would need to be evaluated fully in order to get to the end. Am I misunderstanding something here or is reversed more complicated than that?

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

    #pyplease always enjoying your in-depth review that can be applied to daily Python coding, thank you!

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

    #pyplease
    Really enjoy your videos, thanks for all the great explanations!

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

    Thanks again! Always enjoy these videos. #pyplease

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

    Great video and content.
    Thank you for sharing your knowledge. #pyplease

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

    #pyplease
    Thank you for hosting this giveaway and I really liked the video!

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

    #pyplease -- Thanks for all the great educational videos!

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

    #pyplease love your videos, looking forward to learning more python tips and tricks

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

    #pyplease Seems strange that the built-in list slicing method returns a copy.Iterables could perhaps have their own equivalent of a numpy view mechanism. Maybe too big of a change to be worth it.

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

    Love this channel serving content as bite(more like byte) sized knowledge!
    #pyplease

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

    #pyplease Awesome video as always! Thank you for the giveaway.

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

    Really wonderful job!#pyplease

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

    #pyplease
    Amazing video! Really informative and well explained.

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

    #pyplease I always look forward to your videos and I'm always mind blown by your Python knowledge.

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

    #pyplease
    Learned so much by watching your videos. I love your content keep up the awesome work.

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

    Can you make a video explaining the uses of python with API interactions where arrival ordering is and is not important threading vs multiprocessing? #pyplease

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

      stay away from threading, th-cam.com/video/X7vBbelRXn0/w-d-xo.html,

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

    #pyplease
    As always, great video! I really look forward to your new releases, because I always learn something new! Thank you and keep up the great work!

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

    I've always used [::-1] instead of reversed because I thought they both made copies, but I guess I've just been making copies for no reason.
    Glad to see numpy does things intelligently, though!
    #pyplease

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

      I think the only point using this in python is to reverse a string, I'm not counting overloading the operator.

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

    Thank you for an informative video on a great channel! #pyplease

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

    Hrmm, isn't simply casting to a list seems a little obtuse (though it definitely works). Wouldn't using the "copy" library be more pythonic?
    #pyplease

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

    #pyplease
    Your explanations are simple and on the point... Always! Thank you for the effort making these videos! Keep up the good work!

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

    #pyplease
    Great video. I've learnt someting new :)

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

    To copy, or not to copy, that is the question.
    Whether 'tis nobler in the mind to suffer
    The slings and arrows of unnecessary memory usage,
    Or to watch an mCoding video and learn,
    And by learning end them? To copy, to not copy;
    No more!
    #pyplease

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

    #pyplease this is so interesting thank you so much for your python videos!

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

    #pyplease
    Thank you James for the wonderful Python content you create. I always go into details that other content creators don't.

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

    happy new years james! #pyplease

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

    #pyplease awesome videos!! have really helped me with some hard to grasp concepts in python🔥🔥

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

    #pyplease
    Great video, as always!

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

    #pyplease
    6:39 any specific reason it's list(d.items()) and not d.copy().items()?
    I tend to do the latter and I'd like to know if there's any advantage/disadvantage to the approach I use

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

    I would love to try switching from VS Code to PyCharm #pyplease

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

    can you also explain when a copy is made is it a deep or shallow copy and what is the difference ?
    for instance when iterating over my_list.copy() and mutating it, is it really safe or we have to go all the way and use deepcopy(my_list) or mylist[ : ] ?

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

    It's always a pleaseure to watch your videos. #pyplease

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

    #pyplease I have been using the community edition of PyCharm for so long, I would really love to see what the pro version has to offer....

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

    #pyplease
    informative as always

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

    It’s an awesome explanation #pyplease

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

    #pyplease Thanks for the informative video.