C.D. Reimer wrote: > On 5/16/2015 12:40 PM, Thomas 'PointedEars' Lahn wrote: >> However, for greater efficiency, in general you should call .replace() >> in such a way that the length of the string it operates on is >> minimized. For example, if feasible, always slice *before* .replace(). > > Slice was how I got the slug from the URL in the first place. :)
Consider using a regular expression or the urllib object instead. See RFC 3986, Appendix B, and <https://docs.python.org/3/library/urllib.html>, respectively. > Thank you, You are welcome. > Chris Reimer Please use this or something to that effect in your “From” header field value. -- PointedEars Twitter: @PointedEars2 Please do not cc me. / Bitte keine Kopien per E-Mail. -- https://mail.python.org/mailman/listinfo/python-list