Rule of order for dot operators?
Thomas 'PointedEars' Lahn
PointedEars at web.de
Sun May 17 13:17:06 EDT 2015
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.
More information about the Python-list
mailing list