Skip to content

DOC: Add some documentation strings to xml.dom.minidom. #7908

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

Closed
wants to merge 3 commits into from

Conversation

alexitkes
Copy link
Contributor

Add documentation strings to some methods of the xml.dom.minidom.Element class. It would be possibly better to be able to know some small but important features of these methods directly from pydoc.

The Element.getAttribute method returns an empty string both if there is no such attribute and if an empty string is an explicitly given attribute value. It never returns None.

The Element.getElementsByTagName methods returns all descendants, not direct children only.

Write documentation string for xml.dom.minidom.Element.getAttribute method. I think it would be better to know what exactly it returns from pydoc.
Also write a documentation string for getElementsByTagName method to note that it returns not only direct children.
Write more docstrings to xml.dom.minidom
@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).

Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA (this might be simply due to a missing "GitHub Name" entry in your b.p.o account settings). This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

When your account is ready, please add a comment in this pull request
and a Python core developer will remove the CLA not signed label
to make the bot check again.

Thanks again for your contribution, we look forward to reviewing it!

@alexitkes
Copy link
Contributor Author

Hello.

After using xml.dom.minidom for a while, I think it really lacks documentation strings. For example, I have just been surprised the Element.getAttribute should returns an empty string if the element does not contain such an attribute. I expected it to return None it that case because an empty string may also be an explicitly given attribute value.

So, I think it would be better to be able to know such aspects of xml.dom.minidom behavior from pydoc command. Even though there is a plenty of other sources of this information, pydoc is perhaps easiest to use.

So, first I added documentation strings to a few methods of xml.dom.minidom.Element class.

What do you think?

Thank you.

Alex.

@alexitkes alexitkes changed the title Documentation strings within xml.dom.minidom. DOC: Add some documentation strings to xml.dom.minidom. Jun 28, 2018
@brettcannon
Copy link
Member

Thanks for the PR, but closing as the CLA has not been signed within the last month. If you do decide to sign the CLA we can re-open this PR.

@alexitkes
Copy link
Contributor Author

@brettcannon Ok, I have signed the CLA. Sorry for delay.

@brettcannon
Copy link
Member

@alexitkes unfortunately because you either force-pushed or recreated your master branch that you opened this PR against, GitHub won't let me re-open this PR, so we will need you to open a new PR if you would like us to still look at your proposed changes.

@alexitkes
Copy link
Contributor Author

@brettcannon OK #16355

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

Successfully merging this pull request may close these issues.

4 participants