Aaron Brady wrote:
Shorter is always better.
url+= { '/': '' }.get( url[ -1 ], '/' )

Why bother with spaces or 3 letter-wide token, check this  :o) :
x+={'/':''}.get(x[-1],'/')

Apart from joking, the following proposed solution is by **far** the one I prefer

if not url.endswith('/'):
   url += '/'

Maybe not the shorter, but the most concise and clear to me.

Jean-Michel



--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to