treelib icon indicating copy to clipboard operation
treelib copied to clipboard

Work in progress (do not merge) - serializing and deserializing trees and nodes

Open leonardbinet opened this issue 5 years ago • 3 comments

https://github.com/caesar0301/treelib/issues/85

leonardbinet avatar Dec 16 '19 02:12 leonardbinet

Hello, This could be achieved using pickle package, which is a python built-in package. is other serializing method really needed? I think there's just one aspect that JSON is better than pickle, JSON file is not binary and thus is human-readable while pickle file is binary.

AdeBC avatar Mar 05 '20 16:03 AdeBC

@AdeBC you are right pickle is good for many situations, although here are some of reasons why other serialization formats can be interesting:

  • security: pickle data is not secure you should not unpickle data from unknown sources
  • portability: pickles are not portable among all python versions
  • version control: if you want to track changes
  • readibility

leonardbinet avatar Mar 09 '20 02:03 leonardbinet

Oh, that make sense, security and other features you said are really necessary. Thanks for your hard work

AdeBC avatar Mar 11 '20 08:03 AdeBC