Skip to content

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Oct 8, 2025

It allows to check whether a string can be used as an element or attribute name in XML.


📚 Documentation preview 📚: https://cpython-previews--139768.org.readthedocs.build/

It allows to check whether a string can be used as an element or attribute
name in XML.
xml.sax.utils
-------------

* Add the :func:`~xml.sax.utils.is_valid_name` function, which allows to check
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Add the :func:`~xml.sax.utils.is_valid_name` function, which allows to check
* Add the :func:`~xml.sax.saxutils.is_valid_name` function, which allows to check

While sax.utils exists, the documented module is saxutils.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for noticing. More changes there were needed.

@serhiy-storchaka serhiy-storchaka changed the title gh-139489: Add xml.sax.utils.is_valid_name() gh-139489: Add xml.sax.saxutils.is_valid_name() Oct 8, 2025
@vstinner
Copy link
Member

vstinner commented Oct 8, 2025

Why not adding the function in the xml package level, for example in a xml.utils module?

The function doesn't seem to be specific to the sax implementation. Is it?

@serhiy-storchaka
Copy link
Member Author

There is no an xml.utils module.

@vstinner
Copy link
Member

vstinner commented Oct 8, 2025

There is no an xml.utils module.

I'm suggesting to create such xml.utils module. Ok maybe put the new function directly in the xml top-level package?

@serhiy-storchaka
Copy link
Member Author

This is an interesting idea.

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.

3 participants