-
Notifications
You must be signed in to change notification settings - Fork 91
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
int -> str is added to allowed casts to overcome int to str incompatibility #35
base: master
Are you sure you want to change the base?
Conversation
Great work @InnovArul. |
I believe this is a wrong fix for my issue as it won't work in all cases, e.g. value The correct fix in my opinion would be to pass target type into I will try to code it up tomorrow, if I have the time. |
Thanks for the heads up with this example. I have changed the |
@InnovArul @Rizhiy, how about you get configuration type from the default config value and then force that on incoming value! |
@muzammil360 Such validation is already built-in to yacs with the method |
Ah i see. Thanks for the clarification.
…On Fri, Jan 3, 2020, 11:28 AM Arulkumar ***@***.***> wrote:
@muzammil360 <https://github.com/muzammil360> Such validation is already
built-in to yacs with the method _check_and_coerce_cfg_value_type (here
<https://github.com/rbgirshick/yacs/blob/7b06e280216451b6f8536538548c75b861d9c22c/yacs/config.py#L460>).
But the issue is that, every string is passed through literal_eval which
changes +123 to 123. Now, I have changed the code to not to do
literal_eval if the data type of the input as well as the expected
datatype is a string.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#35?email_source=notifications&email_token=AE3S5IKSCTIWTZTT66KTVYTQ33LKFA5CNFSM4KAMLO5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIAMZNQ#issuecomment-570477750>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE3S5INVK7BYP7MIWXN5FILQ33LKFANCNFSM4KAMLO5A>
.
|
Fix for #26