reference `reftype` should be enforced
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Divmod Axiom |
New
|
Undecided
|
Unassigned |
Bug Description
reftype doesn't do the most obvious thing it could do:
from axiom.store import Store
from axiom.item import Item
from axiom.attributes import reference
class X(Item):
foo = reference()
class Y(Item):
bar = reference(
class Z(Item):
baz = reference()
def main():
s = Store()
print Y(store=s, bar=Z(store=s)).bar
if __name__ == '__main__':
main()
Instead, I guess it does other things - like serve as documentation about what you *should* be putting here. Also it provides a deletion optimization (which ends up being incorrect if you disregard the documentation purpose and make the reference to a different type ...)
It seems Axiom should not allow assignment of the wrong type.