can it be shorter?

Aaron Brady castironpi at gmail.com
Mon Jun 8 06:45:59 EDT 2009


On Jun 7, 6:13 pm, Paul Rubin <http://phr...@NOSPAM.invalid> wrote:
> Aaron Brady <castiro... at gmail.com> writes:
> > url+= { '/': '' }.get( url[ -1 ], '/' )
>
> > Shorter is always better.
>
> url = url.rstrip('/') + '/'

I was joking.  Sheesh.



More information about the Python-list mailing list