title: How to convert any object to a byte array and keep it on memory?
body: <p>I'm trying to build a simple convertor for any object to byte array in Python. I took a look on <code>pickle</code> but it only works creating a file and this is not what I need. I also checked <code>json.dump</code> but some objects need a serializer to be dumped.</p>
  <p>I need a convertor that keeps my object in memory and can convert any object to byte array.</p>