-
Notifications
You must be signed in to change notification settings - Fork 216
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
[FEATURE]: JID #1473
base: main
Are you sure you want to change the base?
[FEATURE]: JID #1473
Conversation
ca8aaf4
to
38f4752
Compare
8707b96
to
cda5059
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this ready for review and merge @amadolid? I went through it and i think there are a couple of things we need to discuss.
@@ -67,15 +66,15 @@ walker allow_other_root_access { | |||
if self.via_all { | |||
Jac.unrestrict(here, self.level); | |||
} else { | |||
Jac.allow_root(here, UUID(self.root_id), self.level); | |||
Jac.allow_root(here, JacLangJID(self.root_id), self.level); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i wonder if we can somehow not having separate handling for jid between jaclang and jac-cloud. It would be cool if the jac code is the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for example, we define a plugin method that converts string to the corresponding JID type
TARCH = TypeVar("TARCH", bound="Architype") | ||
TANCH = TypeVar("TANCH", bound="Anchor") | ||
|
||
JID_REGEX = compile( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd add a docstring here with an example jid.
class Anchor: | ||
"""Object Anchor.""" | ||
|
||
architype: Architype | ||
id: UUID = field(default_factory=uuid4) | ||
root: Optional[UUID] = None | ||
id: Any = field(default_factory=uuid4) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we be more specific on type here and avoid Any
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, the ID could be anything as it's also technically a read only field
|
||
|
||
@dataclass(eq=False, repr=False, kw_only=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we keep repr=False
? since we are defining a custom repr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I remember correctly, it will be only generated if you haven't specified __repr__
source: NodeAnchor | ||
target: NodeAnchor | ||
source: JID["NodeAnchor"] | ||
target: JID["NodeAnchor"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the reference now is only the ID instead of actual NodeAnchor
No description provided.