ratal / mdfreader

Read Measurement Data Format (MDF) versions 3.x and 4.x file formats in python
Other
169 stars 74 forks source link

copy method shallow copies data #125

Closed danielhrisca closed 6 years ago

danielhrisca commented 6 years ago

The copy method does just a shallow copy. If you modify a channel in the initial mdf object you will see this in the copied object as well.

ratal commented 6 years ago

Hi Daniel, Yes indeed this is a shallow copy. I guess you expected a deepcopy() ? I only had the need for this copy function with mdfconverter in mdfreaderui4/5.py

danielhrisca commented 6 years ago

Hello Aymeric,

yes, my first assumption was that it was meant to perform a deep copy

ratal commented 6 years ago

What is your use case for this deepcopy in mdfreader ? You are the first one to mention about this. As mdf class is mostly a dict with a few attributes, it is not that complicated to apply deepcopy I think, but as usual heavy.

ratal commented 6 years ago

I made the documentation of this function more clear by stating this is a shallow copy of object. Do you need deepcopy in mdfreader ?

danielhrisca commented 6 years ago

The clarification is enough