You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
Imported from Launchpad using lp2gh.
The text was updated successfully, but these errors were encountered: