-
Notifications
You must be signed in to change notification settings - Fork 198
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
Suppress very common configure()
type checker error
#1177
Suppress very common configure()
type checker error
#1177
Conversation
315954e
to
1fde8b6
Compare
Hi, thanks for the PR. I don't know why there was a test failure when running the change, but I don't think it's related. I may just need to increase a time out or something. But could I ask you to make a couple of easy changes and I think we'll be good to merge this?
Thanks very much! |
2ee0202
to
f1f9dd2
Compare
I am sorry that I didn't read the contributing guide. |
No need to apologise, always happy to receive contributions! 😃 Tests are all good, so just one thing to check. If wonder if we should add in
just to 100% guarantee the same behaviour if someone passes in no config at all. Other than that, I'm happy to merge this. Thanks! |
This is what I initially did but if you see L1047-L1048, there's already a check for |
Yes, thanks, I actually noticed that too, but a (very subtle) different thing will happen. In one case you'll get this, and in the other, the line you pointed out. To be honest, the whole configuration thing is a bit too twisty these days, but OTOH I don't particularly have the enthusiasm to change stuff, so it is what it is. If we add that line, then it really is for sure 100% equivalent to what was there before!! |
Signed-off-by: Asadullah Shaikh <[email protected]>
f1f9dd2
to
f2d3f16
Compare
Is this style okay or do you want a separate if clause? |
Also what's the difference between these two? Correct me if I'm wrong but isn't L274 an [ |
I think the difference is that I don't think we get an error there because those configuration objects are slightly weird magic things. But like I said, I don't particularly understand... |
Yeah I got mixed up in the Here's the summary:
|
Since the default value was a
str
, passing adict
gave type errors. Since the codebase has very minimal static typing [of only return types], this approach is a clean and pythonic way of suppressing the [false-positive] errors without introducing strict static typing of the parameters.