-
Notifications
You must be signed in to change notification settings - Fork 15
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
Fix/requirements #843
Fix/requirements #843
Conversation
For some reason @Helveg, I am not sure why this was implemented like this? |
…instead of the original str.
…ree__ or __inv__.
@@ -418,6 +418,9 @@ def __init__(self, module=None, **kwargs): | |||
if module is not None: | |||
self.module = module | |||
|
|||
def __inv__(self): | |||
return self.module |
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.
What about self.attr
? is it unused in all this?
This is intentional. The Edit: It's |
Closing this because there must remain a difference between the final I think the correct way is for the Feel free to reopen with new proposal |
Reopening just to get some precision. Will make a new pull request once I have re-implemented it correctly.
I am not sure I understand. If def _set_type(self, type, key=None):
self.child_type = super()._set_type(type, key=False)
return self.fill then why in if hasattr(self.type, "__inv__") and value is not None:
value = self.type.__inv__(value) |
In Python functions are objects too, of the wider family of "callable objects", and have many attributes. In this snippet we check for an
Look at the But anyone could create any object they want and add |
Ok let me see if I understand correctly what the function def tree_of(self, value):
# if value is a node it should have a __tree__ function
if hasattr(value, "__tree__"):
value = value.__tree__()
# if self.type is a bsb class with an __inv__ function
# BTW, maybe it should be elif here
if hasattr(self.type, "__inv__") and value is not None:
value = self.type.__inv__(value)
# else return value as it is
return value So we need to deal with the cases where value is not a |
Your analysis of the
What's a bsb class? 😋
The End of tangent: no "bsb class" has an
It is valid for I would say |
PackageRequirement
to extend from types.object_ConfigurationListAttribute
andConfigurationDictAttribute
closes #842