Python can serialize only the objects that is a built in data type.
In your case, "SomeObject" is a User defined type that Python cannot serialize. If you try to serialize any data type which is not json serializable, you get a TypeError "TypeError: is not JSON serializable". So there should be an intermediate step that converts these non built in data types into Python built in serializable data structure (list, dict, number and string).
So let us convert your SomeObject into a python dictionary, since dictionary is the easiest way to represent your Object(as it has key/value pairs). You could just copy all your SomeObject instance attributes to a new dictionary and you are set!
myDict = self.__dict__.copy()
This myDict can now be the value of your "propertyobject".
After this step is when you convert dictionary to a string (JSON format, but it can be YAML, XML, CSV...) - for us it will be jsonObj = JSON.dumps(finalDict)
Last step is to write jsonObj string to a file on disk!