Message113075
- Summmary lines in docstrings are one line, as Éric points out.
They're summaries, so need not be complete. Use elaboration text as
needed, and omit anything that's not relevant in context. An
alternate wording to consider:
"""Raised by strict parsers for options repeated in an input source."""
In particular, there's no mention of what the kinds of sources are,
since that's not relevant for the exception itself.
- I like the blank line before the ending """, others don't. More
important is consistency within the module, so feel free to coerce it
either way.
- Perhaps read_* should all call the extra argument source= instead of
filename=. ``readfp`` should take `filename` and pass it as `source`
for compatibility. This still makes sense for ``read_file`` since the
"file" part of the name refers to the kind of object that's passed in,
not that the file represents a simple file on the filesystem.
- Since the Duplicate*Error exceptions can now be raised when "reading"
(_read itself is an implementation detail, so that's irrelevant), they
should grow filename, lineno, line constructor arguments. These
should be filled in as much as possible when those exceptions are
raised.
- Adding a ``source`` attribute to exceptions that have ``filename``
attribute is reasonable; they should have the same value. (One should
be a property that mirrors the other.) The ``filename`` parameter and
attribute name must remain for compatibility.
- There's at least one way to make vim show the too-long text with a
violent red background. Appropriate for code, sucks when reading
logfiles. But I'm not a vim user. Whatever tool makes it show up for
you is fine.
- The constructors in Python 3.2 should be compatible with those from
Python 2.7 (IMO). They're currently not: `allow_no_value` should be
allowed positionally and come right after `dict_type`. (This problem
existed before your patch; it should be corrected first.)
- In the docs, "Parse configuration from a dictionary" should probably
be "Load configuration from a dictionary"; most of the parsing effort
is skipped in this case, so this reads a little oddly.
- Indentation in the DuplicateOptionError constructor is a bit weird in
the superclass constructor call. Something like this would be better:
def __init__(self, section, option):
Error.__init__(
self,
"Option %r in section %r already exists" % (option, section))
self.section = section
self.option = option
self.args = (section, option) |
|
Date |
User |
Action |
Args |
2010-08-06 05:51:07 | fdrake | set | recipients:
+ fdrake, ezio.melotti, eric.araujo, brian.curtin, lukasz.langa |
2010-08-06 05:51:06 | fdrake | set | messageid: <1281073866.84.0.784824894258.issue9452@psf.upfronthosting.co.za> |
2010-08-06 05:51:04 | fdrake | link | issue9452 messages |
2010-08-06 05:51:01 | fdrake | create | |
|