Closed AstraLuma closed 7 years ago
Are you calling super().__init__()
?
There is no __init__()
, the class definition is an accurate representation. It's just smaller than the real one.
Can you enumerate the differences between your reduced version and full app?
Way more attributes, including more dicts and lists. Has methods, class methods, and a read-only property descriptor.
The number of attributes shouldn't matter. Are any of the methods, class methods, or properties conflicting with the names of mapped attributes or any other potentially reserved words?
Without seeing the code, I'm not sure what else to say. Can you produce a minimum example by whittling down your code?
headdesk
It's only occurring inside the real application. I pull the models out (hard code format_path
and remove debugging print()
) into a test script and it behaves just fine.
Does yorm have opinions on threading? All of my work is done on background threads (concurrent.futures.ThreadPoolExecutor
).
EDIT: Note that for debugging, I have the pool size set to 1.
I'd image you'd end up with multiple threads trying to overwrite the mapped object's file with potentially different values.
Can you run a test with threading completely removed (not just setting the pool size to 1).
You could also try adding auto_save=False
to the yorm.sync()
decorator and manually calling yorm.save(obj)
in your main thread after making changes.
Oh, data loaded from the file overrides data set by __init__()
.
I'm tracking down an issue where my Dictionaries are not picking up the values given in
__init__()
, instead they use the default values. Problem is, the trivial version works just fine.The trivial version is:
My full app would print
{'count': 0}
in this case, but this reduced version is printing (correctly){'count': 2}
.Will dig in to more tomorrow.