Skip to content
This repository has been archived by the owner on Sep 29, 2023. It is now read-only.

Improved check on using, format, indexed and multiple #188

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

phorward
Copy link
Member

parameters in accordance to recordBones

parameters in accordance to recordBones
@tsteinruecken
Copy link
Contributor

What's the actual improvement here? Why should the parameter using have a default value that can never be used (None is not valid)? Would rather recommend removing the default value for format also (though this parameter is prefilled in other bones where it works correctly).

@phorward
Copy link
Member Author

What's the actual improvement here? Why should the parameter using have a default value that can never be used (None is not valid)?

The reason is only for better usability:

On the wrong bone definition

test = recordBone(descr="test")

the exception message

TypeError: __init__() takes at least 2 arguments (1 given)

is less informative then

NotImplementedError: A recordBone must have 'using' and 'format' parameter, 'multiple=True' and 'indexed=False' is mandatory

as it is the case with this pull request.

@tsteinruecken
Copy link
Contributor

That's the correct behavior. There's a mandatory parameter that you didn't specify. I'd rather recommend removing the default value for format also. (I thought it was a parameter already specified in baseBone, but that's not the case, it is also unique to relational/recordBones)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants