-
Notifications
You must be signed in to change notification settings - Fork 3
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 #7 issue, changing FacetOperatingSystem #47
Conversation
This report came in from the type-checking:
(and again for each parameter) I'm going to push two patches. |
Thanks Alex, I have a hazy idea of the error, I will check your changes after the pushes! |
A follow-on patch will regenerate Make-managed files. References: * https://peps.python.org/pep-0484/#union-types Signed-off-by: Alex Nelson <[email protected]>
The relevant text from the PEP 484 appears to be from this section:
|
Signed-off-by: Alex Nelson <[email protected]>
One more patch coming. |
This is to test if the current spelling in the function can tolerate order changes. No effects were observed on Make-managed files. Signed-off-by: Alex Nelson <[email protected]>
No effects were observed on Make-managed files. Signed-off-by: Alex Nelson <[email protected]>
I've added two more patches to check for, and prevent, confusion of positional arguments vs. keyword parameters. I'm fine if you'd rather they be reverted. Otherwise, this PR looks good to me. The only ontologically-necessary change it needed was the |
Oh wait, one more fix coming. |
No effects were observed on Make-managed files. Signed-off-by: Alex Nelson <[email protected]>
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.
@fabrizio-turchi , if you agree with the change I suggested adding *args
, please feel free to merge. Because it wasn't strictly necessary (the patch just prior to its add confirms order can be tweaked), I'm fine with you asking that change be reverted.
the PR It's fine, I'm only curious of the reasons why you added the parameters *args and **kwargs, did it mean for future extensions of the ontology? |
No, it's a Python syntax thing, possibly just my personal preference or confusion. A Python function can have (1) positional arguments that require a value, (2) positional arguments that specify a default, (3) keyword parameters that require a value, and (4) keyword parameters that specify a default value. If all 4 of those are specified for one function, they must be specified in that order. If (3) is skipped, the syntax appears, to me, ambiguous on when positional-with-default arguments end and keyword-with-default parameters begin. There's a behavior Python lets function-callers trigger that further makes this easier for callers when they use parameter names, but at a trade of some syntactic laxness.
So, apologies for lacking the citation, but the short story is, using |
thanks a million for your explanation😊 |
I add all properties included in the OperatingSystemFacet class and adding the type checking.
I also updated the example.py.