Code review comment for lp:~elopio/u1-test-utils/page-objects

Revision history for this message
Natalia Bidart (nataliabidart) wrote :

Regarding the comments for attributes, as you can see in the pep-257 intro:

'A docstring is a string literal that occurs as the first statement in a module, function, class, or method definition. Such a docstring becomes the __doc__ special attribute of that object.'

So, class or instance variables do not have docstrings, ergo the clarification added in the source (which comes handy to the one inspecting the class) should be a comment, if not relevant to go into the class' docstring. I personally prefer adding those details to the class' docstring, so this particular case:

329 +class YourAccount(Page):
330 +
331 + title = "{0}'s details"
332 + """The title of the page. The parameter is the user name."""

would result in:

329 +class YourAccount(Page):
3xx + """A page showing the details for the currently logged in user.
3xx +
3xx + This class defines a class attribute 'title' that represents the title of
3xx + the page, and is built using the user name.
3xx +
3xx + """
3xx +
332 + title = "{0}'s details"

And since we're talking about pep-257, the docstring for make_all_information_available_to_website (and every other docstring that has the first line longer than a single 80 column line) is not pep-257 compliant.

Any chance you fix that?

« Back to merge proposal