-
Notifications
You must be signed in to change notification settings - Fork 44
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
Optional arguments in environs implementation methods #741
Comments
Yes, please do both of these things! |
@benkiel, the |
Hey @knutnergaard I'm unsure what you mean by absolute in this context, could you elaborate? |
@benkiel, sorry, absolute is probably not the right word. I simply mean mandatory or non-optional. |
Yes, we should note the additional ones in the private method. |
I'm not sure I understand, but I take it to mean that documented optional values, |
Sorry, no; we should move those optional things up to the non-private method and document there. Sorry, I lost the thread on this; please do what Tal said and ignore me! |
@benkiel, @typesupply, sorry for harping on this further, but it just occurred to me that we might be talking past each other a bit here. By «optional» arguments, are we talking about predefined keyword arguments or optional types in the way |
@knutnergaard AH! Yes, I was talking about optional as predefined keyword args: ie, |
@benkiel Thanks, although when you say:
I assume you mean the other way around, i.e., that the public methods should have default arguments, but not the private ones? |
Yes, you are correct, we should just have |
@benkiel Removing the default values for certain methods breaks the code in a few places, at least in |
@knutnergaard Yes, we should do that, thank you! |
Ref. this post:
Originally posted by @typesupply in #207 (comment)
There are indeed a few cases of default values in the environment implementation of methods. If desired, I can convert them to be absolute as I come across them while implementing the type annotation and working on the docs.
Also, when running mypy, there will be a conflict between the public and private methods whenever one employs optional values and the other does not. The best thing, unless you want to ignore this, is to implement a conditional to eliminate the possibility of
None
wherever it's incompatible. I can do this too if you wish.The text was updated successfully, but these errors were encountered: