reference `reftype` should be enforced

Bug #1205490 reported by Jean-Paul Calderone
12
This bug affects 2 people
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(reftype=X)

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.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.