GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-139489: Add xml.is_valid_name() by serhiy-storchaka · Pull Request #139768 · python/cpython Conversation
| |||||||||||||||||||||||||||||||||||||||
|
Why not adding the function in the The function doesn't seem to be specific to the sax implementation. Is it? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
There is no an |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I'm suggesting to create such |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This is an interesting idea. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This PR is stale because it has been open for 30 days with no activity. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
See also Place for XML helper functions discussion. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Documentation build overview
18 files changed ·
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Co-authored-by: Victor Stinner <[email protected]>
| ``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.
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a link to the specs if any?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Link found in the implementation: https://www.w3.org/TR/xml/#NT-Name.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
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 an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
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 an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
That's also ok. As long as the online docs contain some links to some specifications, it's ok.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| @@ -0,0 +1,25 @@ | |||
| lazy import re | |||
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
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 an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
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 an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
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.
There was an error while loading. Please reload this page.
| @@ -0,0 +1,25 @@ | |||
| lazy import re | |||
|
|
|||
|
|
|||
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest adding an __all__
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
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 an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
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.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.