Modify ↓
Opened 20 years ago
Closed 20 years ago
#2761 closed defect (fixed)
Typos in trac.web.href.Href docstring
| Reported by: | Owned by: | Christian Boos | |
|---|---|---|---|
| Priority: | low | Milestone: | 0.10 |
| Component: | general | Version: | devel |
| Severity: | trivial | Keywords: | |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description
Patch included for three minor docstring changes:
- First has a title that mentions how it behaves with None as a positional argument… yet there's no None.
- In Href.something, Href is a class instance, not a function.
- This was originally phrased as if introduced for the first time, yet it is already mentioned in lines 44-50. Personally I would rather merge the two mentions into one, lines 102-109 don't really say anything that 44-50 don't already.
Index: trac/web/href.py
===================================================================
--- trac/web/href.py (revision 2905)
+++ trac/web/href.py (working copy)
@@ -38,11 +38,11 @@
If a positional parameter evaluates to None, it will be skipped:
- >>> href('ticket', 540, 'attachment')
+ >>> href('ticket', 540, 'attachment', None)
'/trac/ticket/540/attachment'
The first path segment can also be specified by calling an attribute
- of the function, as follows:
+ of the instance, as follows:
>>> href.ticket(540)
'/trac/ticket/540'
@@ -99,8 +99,8 @@
>>> href('ticket', 540)
'https://projects.edgewall.com/trac/ticket/540'
- Finally, the first path segment of the URL to generate can be specified in
- the following way, mainly to improve readability:
+ In common usage, it may improve readability to use the function-calling
+ ability for the first component of the URL as mentioned earlier:
>>> href = Href('/trac')
>>> href.ticket(540)
Attachments (0)
Change History (2)
comment:1 by , 20 years ago
| Milestone: | → 0.10 |
|---|---|
| Owner: | changed from to |
| Severity: | minor → trivial |
comment:2 by , 20 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Patch applied in r3161, thanks!
Note:
See TracTickets
for help on using tickets.



Patch looks OK.