Skip to content
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

Cannot remove parameters #16

Open
mitar opened this issue Feb 5, 2018 · 5 comments
Open

Cannot remove parameters #16

mitar opened this issue Feb 5, 2018 · 5 comments

Comments

@mitar
Copy link

mitar commented Feb 5, 2018

In my case I remove all arguments accepted in parent class in child's class method. It seems there is no way to also remove them from a docstring and it is automatically copied over? So I would like to remove the whole section. It seems I have to define an otherwise empty "Parameters" section.

(Working in numpy style.)

@mitar mitar changed the title Cannot remove parameter Cannot remove parameters Feb 5, 2018
@ghost
Copy link

ghost commented Feb 5, 2018

Hi mitar. Yes, the numpy docstring style does not try to parse individual arguments separately. It only works on a section-by-section basis.

Thus if you want to use a different Pameters section in you child class' method than in the parent's docstring, you need to explicitly write that portion of the docstring.

Alternatively you can write a custom docstring style that permits you to remove individual sections of an numpy docstring

@ghost
Copy link

ghost commented Feb 23, 2018

@mitar I may be able to find time to implement a per-parameter inheritance style. Would this be of significant use for you still?

@mitar
Copy link
Author

mitar commented Feb 23, 2018

Yes. It is not a biggy, but it would make it cleaner. Thanks!

@ghost
Copy link

ghost commented Feb 24, 2018

@mitar any chance you could point me to your code where this is coming into play? I want to have a better idea of what a suitable solution might be.

@mitar
Copy link
Author

mitar commented Feb 26, 2018

Here is an example. Inheriting from here.

We are on purpose not adhering to Liskov substitution principle because we inspect at runtime.

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

No branches or pull requests

1 participant