Message139514
| Author |
r.david.murray |
| Recipients |
Cal.Leeming, r.david.murray |
| Date |
2011年06月30日.19:33:47 |
| SpamBayes Score |
2.745074e-07 |
| Marked as misclassified |
No |
| Message-id |
<1309462427.93.0.64737904474.issue12455@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Well, three occurrences means you only have three methods to patch (and two of them are trivial). But I agree that copying the non-trivial method doesn't look fun from a maintenance perspective.
You could also try using an object that is not a subclass of str. The problem with subclassing str is that some (most?) string methods do not do a subclass check but directly call the C implementation of the method. I think there's an issue in the tracker somewhere about that.
The problem with not subclassing string, of course, is that you may end up implementing a lot of methods on your object to get it to play nicely with urllib2's assumption that it *is* a string. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2011年06月30日 19:33:48 | r.david.murray | set | recipients:
+ r.david.murray, Cal.Leeming |
| 2011年06月30日 19:33:47 | r.david.murray | set | messageid: <1309462427.93.0.64737904474.issue12455@psf.upfronthosting.co.za> |
| 2011年06月30日 19:33:47 | r.david.murray | link | issue12455 messages |
| 2011年06月30日 19:33:47 | r.david.murray | create |
|