Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reference reftype should be enforced #20

Open
divmod-migration opened this issue Jun 28, 2014 · 0 comments
Open

reference reftype should be enforced #20

divmod-migration opened this issue Jun 28, 2014 · 0 comments

Comments

@divmod-migration
Copy link

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.

@mithrandi mithrandi added enhancement and removed New labels Feb 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants