home.social

#deepcopy — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #deepcopy, aggregated by home.social.

  1. An exercise to help build the right mental model for Python data. The “Solution” link uses memory_graph to visualize execution and reveals what’s actually happening:
    - Solution: memory-graph.com/#codeurl=http
    - Explanation: github.com/bterwijn/memory_gra

    If you think this could help Python students and educators, please boost.

  2. An exercise to help build the right mental model for Python data. The “Solution” link uses memory_graph to visualize execution and reveals what’s actually happening:
    - Solution: memory-graph.com/#codeurl=http
    - Explanation: github.com/bterwijn/memory_gra

    If you think this could help Python students and educators, please boost.

    #Python #programming #memory_graph #DeepCopy #ShallowCopy

  3. An exercise to help build the right mental model for Python data. The “Solution” link uses memory_graph to visualize execution and reveals what’s actually happening:
    - Solution: memory-graph.com/#codeurl=http
    - Explanation: github.com/bterwijn/memory_gra

    If you think this could help Python students and educators, please boost.

    #Python #programming #memory_graph #DeepCopy #ShallowCopy

  4. An exercise to help build the right mental model for Python data. The “Solution” link uses memory_graph to visualize execution and reveals what’s actually happening:
    - Solution: memory-graph.com/#codeurl=http
    - Explanation: github.com/bterwijn/memory_gra

    If you think this could help Python students and educators, please boost.

    #Python #programming #memory_graph #DeepCopy #ShallowCopy

  5. An exercise to help build the right mental model for Python data. The “Solution” link uses memory_graph to visualize execution and reveals what’s actually happening:
    - Solution: memory-graph.com/#codeurl=http
    - Explanation: github.com/bterwijn/memory_gra

    If you think this could help Python students and educators, please boost.

    #Python #programming #memory_graph #DeepCopy #ShallowCopy

  6. Python copies:
    - c1: assignment, nothing is copied, all the values are shared
    - c2: shallow copy, only the first value is copied, all the underlying values are shared
    - c3: custom copy, you decide what is copied and shared
    - c4: deep copy, everything is copied, nothing is shared

    🧠 Learn the right mental model to think about Python data: github.com/bterwijn/memory_gra

    🎥 See the Quick Intro video for the VS Code setup: youtu.be/23_bHcr7hqo

  7. Deep Copy vs Reference Copy of Arrays in C# Tip #46 - Understanding array copying: reference types share the same memory (like a shared toy box), while deep copies create separate data. Use Clone(), Array.Copy(), or ToArray() for deep copies.
    #ArrayCopy #DeepCopy #ReferenceTypes #CSharp #ProgrammingBasic #LearnCoding

  8. Deep Copy vs Reference Copy of Arrays in C# Tip #46 - Understanding array copying: reference types share the same memory (like a shared toy box), while deep copies create separate data. Use Clone(), Array.Copy(), or ToArray() for deep copies.
    #ArrayCopy #DeepCopy #ReferenceTypes #CSharp #ProgrammingBasic #LearnCoding

  9. @matt

    This does bite people in Python, as it applies to lists and dicts in addition to Pandas or whatever that is.

    list and dict have copy() methods, but they're shallow copies. If you have mutable objects in your list or dict, those can be changed by someone with a copy...

    Use copy.deepcopy() to ensure you get a mutable object that no one else (barring evil intent...) has a handle to fiddle with its contents.

    #python #mutable #DeepCopy

  10. @matt

    This does bite people in Python, as it applies to lists and dicts in addition to Pandas or whatever that is.

    list and dict have copy() methods, but they're shallow copies. If you have mutable objects in your list or dict, those can be changed by someone with a copy...

    Use copy.deepcopy() to ensure you get a mutable object that no one else (barring evil intent...) has a handle to fiddle with its contents.

    #python #mutable #DeepCopy

  11. @matt

    This does bite people in Python, as it applies to lists and dicts in addition to Pandas or whatever that is.

    list and dict have copy() methods, but they're shallow copies. If you have mutable objects in your list or dict, those can be changed by someone with a copy...

    Use copy.deepcopy() to ensure you get a mutable object that no one else (barring evil intent...) has a handle to fiddle with its contents.

    #python #mutable #DeepCopy

  12. @matt

    This does bite people in Python, as it applies to lists and dicts in addition to Pandas or whatever that is.

    list and dict have copy() methods, but they're shallow copies. If you have mutable objects in your list or dict, those can be changed by someone with a copy...

    Use copy.deepcopy() to ensure you get a mutable object that no one else (barring evil intent...) has a handle to fiddle with its contents.

    #python #mutable #DeepCopy

  13. @matt

    This does bite people in Python, as it applies to lists and dicts in addition to Pandas or whatever that is.

    list and dict have copy() methods, but they're shallow copies. If you have mutable objects in your list or dict, those can be changed by someone with a copy...

    Use copy.deepcopy() to ensure you get a mutable object that no one else (barring evil intent...) has a handle to fiddle with its contents.

    #python #mutable #DeepCopy