This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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:48r.david.murraysetrecipients: + r.david.murray, Cal.Leeming
2011-06-30 19:33:47r.david.murraysetmessageid: <1309462427.93.0.64737904474.issue12455@psf.upfronthosting.co.za>
2011-06-30 19:33:47r.david.murraylinkissue12455 messages
2011-06-30 19:33:47r.david.murraycreate