| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
It allows to check whether a string can be used as an element or attribute name in XML.
|
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? |
Sorry, something went wrong.
|
There is no an xml.utils module. |
Sorry, something went wrong.
I'm suggesting to create such xml.utils module. Ok maybe put the new function directly in the xml top-level package? |
Sorry, something went wrong.
|
This is an interesting idea. |
Sorry, something went wrong.
|
This PR is stale because it has been open for 30 days with no activity. |
Sorry, something went wrong.
|
See also Place for XML helper functions discussion. |
Sorry, something went wrong.
Documentation build overview18 files changed · ± 18 modified ± Modified |
Sorry, something went wrong.
Co-authored-by: Victor Stinner <vstinner@python.org>
| ``False`` otherwise. | ||
|
|
||
| Almost all characters are permitted in names, except control characters and | ||
| those which either are or reasonably could be used as delimiters. |
There was a problem hiding this comment.
Maybe add a link to the specs if any?
Sorry, something went wrong.
There was a problem hiding this comment.
Link found in the implementation: https://www.w3.org/TR/xml/#NT-Name.
Sorry, something went wrong.
There was a problem hiding this comment.
I think it would be good to add it in the online docs as well. It'll be more accessible.
Sorry, something went wrong.
There was a problem hiding this comment.
I am going to add several more functions. Some functions will need several links, and some links will be repeated for different functions. If we want to add links, it is better to add root links to the XML specifications at the top of the module documentation.
Sorry, something went wrong.
There was a problem hiding this comment.
That's also ok. As long as the online docs contain some links to some specifications, it's ok.
Sorry, something went wrong.
| @@ -0,0 +1,25 @@ | |||
| lazy import re | |||
There was a problem hiding this comment.
Are we worried about the stability of xml.utils? Maybe we could have xml._utils first and then promote it to a public module later?
Sorry, something went wrong.
There was a problem hiding this comment.
I'm also in favor of making this sub-module private (rename to xml._utils). There is a risk that developers start depending on xml.utils.is_valid_name name and it would break projects if the function is moved later (ex: to xml/__init__.py).
Sorry, something went wrong.
There was a problem hiding this comment.
xml and xml.utils were two initial suggestions, and they got the same amount of voices. If there is a chance of xml.utils been documented officially, it is better to keep this name from beginning. It is also more pickle-friendly.
Sorry, something went wrong.
| @@ -0,0 +1,25 @@ | |||
| lazy import re | |||
|
|
|||
|
|
|||
There was a problem hiding this comment.
I'd suggest adding an __all__
Sorry, something went wrong.
There was a problem hiding this comment.
It's needed. Currently, the re module is exposed as a xml attribute:
$ ./python
>>> import xml
>>> xml.re
<module 're' from '/home/vstinner/python/main/Lib/re/__init__.py'>
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM.
I would prefer having a private sub-module (xml._utils), but I don't have a strong opinion on it.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
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/