Let's not use "warnings" module. Instead, import logging and "logging.warn(...)", usually.
In this case, though, I would be just as happy with an assertion.
if '_id' in data: if record_id is not None: assert data['_id'] == record_id ...
Maybe drop the "record_id" member and make record_id a @property like record_type. Maybe we can drop all "_id" from code except for the getter.
Do we need a setter property also?
« Back to merge proposal
Let's not use "warnings" module. Instead, import logging and "logging. warn(.. .)", usually.
In this case, though, I would be just as happy with an assertion.
if '_id' in data:
if record_id is not None:
assert data['_id'] == record_id
...
Maybe drop the "record_id" member and make record_id a @property like record_type. Maybe we can drop all "_id" from code except for the getter.
Do we need a setter property also?