-
Notifications
You must be signed in to change notification settings - Fork 294
Document exceptions in constants module #369
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
Conversation
I'm not as well-versed in the html5lib module as others, so please feel free to comment on improvements that should be made to the suggested text. |
@gsnedders @jgraham Can one of you review this please? |
html5lib/constants.py
Outdated
@@ -2939,8 +2939,14 @@ | |||
|
|||
|
|||
class DataLossWarning(UserWarning): | |||
"""Raised whenever html5lib changes something in such a way that some input data is lost""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's be more specific:
Raised when the current tree is unable to represent the input data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll change this. Thanks!
html5lib/constants.py
Outdated
pass | ||
|
||
|
||
class ReparseException(Exception): | ||
"""Raised when the parser should restart parsing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should really be internal; it should never be raised through any public interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way the docs are structured, it's difficult to make this not show up in the docs. I'll take away the docstring, but that's how it's going to have to live for 1.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably just _
prefix it, I guess?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure! If that's important, someone who is not me can write up an issue for making those changes and make them. If that makes it in time for 1.0, that's cool. Otherwise I'm not worrying about this.
^^^ That adjusts the docstrings for those two classes per @gsnedders' comments. |
AppVeyor is failing with this:
That has nothing to do with this PR, so I'm going to ignore it. |
We also have a Travis failure, seemingly because us testing against six==1.9 and pytest now requiring |
Thank you! |
This adds docstrings to the exceptions in the constants module for #307.