can it be shorter?

Aaron Brady castironpi at gmail.com
Mon Jun 8 12:45:59 CEST 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