I've used this syntax many, many times to pickle a file, but the truth is I don't understand what is actually happening. I just know that it gives me the result that I want.
with open('some_model_name.pickle', 'wb') as to_write:
pickle.dump(some_model_object, to_write)
But what is actually happening? What if I don't specify wb? What is as to_write?
Same with when I read my model back in:
with open(path+'some_model_name.pickle', 'rb') as to_read:
some_model_object = pickle.load(to_read)